mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
UPnP: COM constructor never returns false anymore
This commit is contained in:
parent
9159e8f002
commit
4d13c48e5c
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user