From 88d891a44861ae5b2f1750f881fc257cd201b517 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Fri, 26 Aug 2016 02:50:08 +0200 Subject: [PATCH] Don't throw if list ends and delete urls properly. --- src/upnp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/upnp.cpp b/src/upnp.cpp index 4e5f103..2dc7ff1 100644 --- a/src/upnp.cpp +++ b/src/upnp.cpp @@ -56,6 +56,7 @@ namespace kuu { operator struct UPNPUrls* () { return &urls; } UPNPUrlsWithInitFlag* operator-> () { return this; } + bool operator not() const { return not initialized; } }; //see: http://stackoverflow.com/questions/24611215/one-liner-for-raii-on-non-pointer @@ -280,7 +281,7 @@ namespace kuu { retval.push_back(redir); } - else { + else if (713 != r) { throw UPNPException(r, "Error in invocation of UPNP_GetGenericPortMappingEntry()", strupnperror(r)); }