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 c5d8862..66900af 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 ff0e32b..8a33873 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__));
        }
 
        /**