aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/portmanager.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/portmanager.lua b/core/portmanager.lua
index 95d42b77..38c74b66 100644
--- a/core/portmanager.lua
+++ b/core/portmanager.lua
@@ -216,7 +216,9 @@ function close(interface, port)
end
function get_service_at(interface, port)
- local data = active_services:search(nil, interface, port)[1][1];
+ local data = active_services:search(nil, interface, port);
+ if not data or not data[1] or not data[1][1] then return nil, "not-found"; end
+ data = data[1][1];
return data.service, data.server;
end