]> git.mxchange.org Git - core.git/commitdiff
setListenerInstance() does not allow NULL, so don't set it.
authorRoland Haeder <roland@mxchange.org>
Fri, 23 Jan 2015 20:57:03 +0000 (21:57 +0100)
committerRoland Haeder <roland@mxchange.org>
Fri, 23 Jan 2015 20:57:03 +0000 (21:57 +0100)
Signed-off-by: Roland Häder <roland@mxchange.org>
inc/classes/main/container/socket/class_SocketContainer.php
inc/classes/main/file_directories/binary/class_BaseBinaryFile.php

index c5d886290286705e14d2e5ec2b83ff687b85af85..66900af5309622e903930f3def7bfa987af2ae7a 100644 (file)
@@ -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);
index ff0e32ba2dbf959d638065a8a5a8202b3090c185..8a33873500e5edad8ff773813bc024d5536181ce 100644 (file)
@@ -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__));
        }
 
        /**