From: Roland Häder Date: Thu, 21 Feb 2013 22:57:14 +0000 (+0000) Subject: Added required assert() to make sure that the requested data in the array is availabl... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=193e418fd76d06a69d5031b9702fa0c093c95cad;p=hub.git Added required assert() to make sure that the requested data in the array is available (do always use my constants if you create such arrays on your own) --- diff --git a/application/hub/main/discovery/package/class_PackageRecipientDiscovery.php b/application/hub/main/discovery/package/class_PackageRecipientDiscovery.php index 5567d36ed..040c3083b 100644 --- a/application/hub/main/discovery/package/class_PackageRecipientDiscovery.php +++ b/application/hub/main/discovery/package/class_PackageRecipientDiscovery.php @@ -59,6 +59,9 @@ class PackageRecipientDiscovery extends BaseHubDiscovery implements Discoverable * @return void */ public function discoverRecipients (array $packageData) { + // This must be available + assert($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]); + // First try out the direct recipient (session id) try { // Get instance (should not break) @@ -90,6 +93,9 @@ class PackageRecipientDiscovery extends BaseHubDiscovery implements Discoverable * @todo The if() does only check for TCP, not UDP, e.g. try to get a $handlerInstance here */ public function discoverRawRecipients (array $decodedData) { + // This must be available + assert($decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT]); + // First clear all recipients $this->clearRecipients();