Added handling of NPE (which is fine here)
authorRoland Häder <roland@mxchange.org>
Fri, 18 May 2012 20:23:58 +0000 (20:23 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 18 May 2012 20:23:58 +0000 (20:23 +0000)
inc/classes/main/class_BaseFrameworkSystem.php

index 7ad8f74..b3ad65f 100644 (file)
@@ -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)) {