From a17d24f0b0964ec18e1ce9f810ff36527f6a9b1e Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 6 Dec 2009 16:21:58 +0000 Subject: - Patch #652232 by moshe weitzman: don't assume that session exists during batch cleanup. --- includes/batch.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'includes') diff --git a/includes/batch.inc b/includes/batch.inc index 2f0d26055..4b3e0f365 100644 --- a/includes/batch.inc +++ b/includes/batch.inc @@ -448,10 +448,12 @@ function _batch_finished() { $_batch = $batch; $batch = NULL; - // Clean-up the session. - unset($_SESSION['batches'][$batch['id']]); - if (empty($_SESSION['batches'])) { - unset($_SESSION['batches']); + // Clean-up the session. Not needed for CLI updates. + if (isset($_SESSION)) { + unset($_SESSION['batches'][$batch['id']]); + if (empty($_SESSION['batches'])) { + unset($_SESSION['batches']); + } } // Redirect if needed. -- cgit v1.2.3