From: Roland Haeder Date: Fri, 23 Jan 2015 20:57:03 +0000 (+0100) Subject: setListenerInstance() does not allow NULL, so don't set it. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a6f1d3c871c6847c5b81fd1537647b297e1abcf8;p=core.git setListenerInstance() does not allow NULL, so don't set it. Signed-off-by: Roland Häder --- diff --git a/inc/classes/main/container/socket/class_SocketContainer.php b/inc/classes/main/container/socket/class_SocketContainer.php index c5d88629..66900af5 100644 --- a/inc/classes/main/container/socket/class_SocketContainer.php +++ b/inc/classes/main/container/socket/class_SocketContainer.php @@ -54,8 +54,11 @@ class SocketContainer extends BaseContainer implements Registerable { // Set the resource ... $containerInstance->setSocketResource($socketResource); - // ..., listener instance ... - $containerInstance->setListenerInstance($listenerInstance); + // Is a listener instance given? + if ($listenerInstance instanceof Listenable) { + // ..., listener instance ... + $containerInstance->setListenerInstance($listenerInstance); + } // END - if // ... and package data $containerInstance->setPackageData($packageData); diff --git a/inc/classes/main/file_directories/binary/class_BaseBinaryFile.php b/inc/classes/main/file_directories/binary/class_BaseBinaryFile.php index ff0e32ba..8a338735 100644 --- a/inc/classes/main/file_directories/binary/class_BaseBinaryFile.php +++ b/inc/classes/main/file_directories/binary/class_BaseBinaryFile.php @@ -280,7 +280,7 @@ class BaseBinaryFile extends BaseFile { // ... to write it back into the file $this->flushFileHeader(); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); } /** @@ -294,7 +294,7 @@ class BaseBinaryFile extends BaseFile { // Seek to currently ("old") saved position $this->seek($this->getSeekPosition()); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); } /** @@ -506,7 +506,7 @@ class BaseBinaryFile extends BaseFile { // Rewind seek position (to beginning of file) and update/flush file header $this->rewindUpdateSeekPosition(); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); } /**