small fix when finishing tasks

This commit is contained in:
Serhiy Mytrovtsiy
2020-01-25 20:38:51 +01:00
parent 8f2eb5a3a2
commit e1e4145a00

View File

@@ -71,7 +71,7 @@ class Battery: Module {
}
public func stop() {
if self.task!.state.isRunning {
if self.task != nil && self.task!.state.isRunning {
self.task?.pause()
}
}