*
* @author Roland Haeder <webmaster@ship-simu.org>
* @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
*
* @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)) {
$fieldArray = $resultInstance->current();
//* DEBUG: */ $this->debugOutput($fieldName.':<pre>'.print_r($fieldArray, true).'</pre>');
+ // 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;