diff --git a/scripts/bittorrent-discovery.nse b/scripts/bittorrent-discovery.nse index e6cefa770..0fbd22d59 100644 --- a/scripts/bittorrent-discovery.nse +++ b/scripts/bittorrent-discovery.nse @@ -64,9 +64,15 @@ action = function() local t = bittorrent.Torrent:new() if filename then - t:load_from_file(filename) + local status, err = t:load_from_file(filename) + if not status then + return stdnse.format_output(false, err) + end elseif magnet then - t:load_from_magnet(magnet) + local status, err = t:load_from_magnet(magnet) + if not status then + return stdnse.format_output(false, err) + end end t:trackers_peers() t:dht_peers(timeout)