From 762d56cf9e745d39bd57c44edebd96205ff5ade7 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Wed, 10 Jul 2013 18:19:52 -0400
Subject: [PATCH] Implement Upgrader::abort

Add forgotten abort() method of the Upgrader trampoline class, and allow
getErrors() not to crash if not upgrading
---
 include/class.upgrader.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/class.upgrader.php b/include/class.upgrader.php
index e17b0a4b2..ded4a344f 100644
--- a/include/class.upgrader.php
+++ b/include/class.upgrader.php
@@ -61,6 +61,11 @@ class Upgrader {
         return !strcasecmp($this->getState(), 'aborted');
     }
 
+    function abort($msg, $debug=false) {
+        if ($this->getCurrentStream())
+            $this->getCurrentStream()->abort($msg, $debug);
+    }
+
     function getState() {
         return $this->state;
     }
@@ -108,7 +113,8 @@ class Upgrader {
     }
 
     function getErrors() {
-        return $this->getCurrentStream()->getError();
+        if ($this->getCurrentStream())
+            return $this->getCurrentStream()->getError();
     }
 
     function getNextAction() {
-- 
GitLab