X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fclass_BaseFrameworkSystem.php;h=b3ad65ff8cc163cea7d0c01f00b6e36a4d1ec059;hb=8388b0ef4894097cbd2f44d0efb29e1d8e64a728;hp=36d2221a65e195ab99d76dd255a494d64a2b1307;hpb=e87d503aab1df972c4c5b6eec1d095a974bb7c2f;p=core.git diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 36d2221a..b3ad65ff 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -5,7 +5,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -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)) { @@ -1628,11 +1636,17 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $fieldArray = $resultInstance->current(); //* DEBUG: */ $this->debugOutput($fieldName.':
'.print_r($fieldArray, true).'
'); + // Convert dashes to underscore + $fieldName = $this->convertDashesToUnderscores($fieldName); + // Does the field exist? if (isset($fieldArray[$fieldName])) { // Get it $fieldValue = $fieldArray[$fieldName]; - } // END - if + } else { + // Missing field entry, may require debugging + $this->debugOutput($this->__toString() . ':fieldname=' . $fieldName . ' not found!'); + } // Return it return $fieldValue;