summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/batch.inc10
1 files changed, 6 insertions, 4 deletions
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.