diff --git a/commands/core/drupal/batch_7.inc b/commands/core/drupal/batch_7.inc
index 1c0259d..c5c2bb1 100644
--- a/commands/core/drupal/batch_7.inc
+++ b/commands/core/drupal/batch_7.inc
@@ -58,7 +58,7 @@ function _drush_backend_batch_process($command = 'batch-process') {
       else {
         $data = drush_backend_invoke($command, array($batch['id']));
       }
-      $finished = drush_get_error() || !$data || ($data['context']['drush_batch_process_finished'] == TRUE);
+      $finished = drush_get_error() || !$data || (isset($data['context']['drush_batch_process_finished']) && $data['context']['drush_batch_process_finished'] == TRUE);
     }
   }
 }
