From: Roland Häder Date: Fri, 18 May 2012 20:23:58 +0000 (+0000) Subject: Added handling of NPE (which is fine here) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0e286b4f5a72309b0d7b957919733cc71303bc11;p=core.git Added handling of NPE (which is fine here) --- diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 7ad8f74d..b3ad65ff 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -1398,8 +1398,16 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return void */ public function debugOutput ($message, $doPrint = true) { - // Get debug instance - $debugInstance = $this->getDebugInstance(); + // Set debug instance to NULL + $debugInstance = NULL; + + // Try it: + try { + // Get debug instance + $debugInstance = $this->getDebugInstance(); + } catch (NullPointerException $e) { + // The debug instance is not set (yet) + } // Is the debug instance there? if (is_object($debugInstance)) {