diff --git a/src/scheduler.js b/src/scheduler.js index 0db5032bb..c591af754 100644 --- a/src/scheduler.js +++ b/src/scheduler.js @@ -66,7 +66,7 @@ function sync(callback) { return iteratorDone(); // nothing changed } - var killContainers = !appState.cronJobs; // keep the old containers on 'startup' + var killContainers = appState && !appState.cronJobs; // keep the old containers on 'startup' stopJobs(app.id, appState, killContainers, function (error) { if (error) debug('Error stopping jobs for %s : %s', app.id, error.message);