UPnP: Fixed server crash on failure to find UPnP device

https://crash.pmmp.io/view/5241010
This commit is contained in:
Dylan K. Taylor 2021-10-01 23:27:58 +01:00
parent c7e9138994
commit 81d5598e96
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -50,9 +50,9 @@ final class UPnPNetworkInterface implements NetworkInterface{
public function start() : void{
$this->logger->info("Attempting to portforward...");
$this->serviceURL = UPnP::getServiceUrl();
try{
$this->serviceURL = UPnP::getServiceUrl();
UPnP::portForward($this->serviceURL, Internet::getInternalIP(), $this->port, $this->port);
$this->logger->info("Forwarded $this->ip:$this->port to external port $this->port");
}catch(UPnPException $e){