diff --git a/src/device-state.coffee b/src/device-state.coffee index 0ed2c218..e98c129d 100644 --- a/src/device-state.coffee +++ b/src/device-state.coffee @@ -469,8 +469,10 @@ module.exports = class DeviceState extends EventEmitter if !@scheduledApply? || (isFromApi && @cancelDelay) @scheduledApply = { force, delay } if isFromApi - # Cancel promise delay if call came from api to prevent waiting due to backoff - @cancelDelay() + # Cancel promise delay if call came from api to + # prevent waiting due to backoff (and if we've + # previously setup a delay) + @cancelDelay?() else # If a delay has been set it's because we need to hold off before applying again, # so we need to respect the maximum delay that has been passed