UPnP: COM constructor never returns false anymore

This commit is contained in:
Dylan K. Taylor 2019-12-05 16:07:06 +00:00
parent 9159e8f002
commit 4d13c48e5c

View File

@ -50,7 +50,7 @@ abstract class UPnP{
$com = new \COM("HNetCfg.NATUPnP");
/** @noinspection PhpUndefinedFieldInspection */
if($com === false or !is_object($com->StaticPortMappingCollection)){
if(!is_object($com->StaticPortMappingCollection)){
throw new \RuntimeException("Failed to portforward using UPnP. Ensure that network discovery is enabled in Control Panel.");
}
@ -70,7 +70,7 @@ abstract class UPnP{
/** @noinspection PhpUndefinedClassInspection */
$com = new \COM("HNetCfg.NATUPnP");
/** @noinspection PhpUndefinedFieldInspection */
if($com === false or !is_object($com->StaticPortMappingCollection)){
if(!is_object($com->StaticPortMappingCollection)){
return false;
}
/** @noinspection PhpUndefinedFieldInspection */