Index: nse_main.lua =================================================================== --- nse_main.lua (revision 19648) +++ nse_main.lua (working copy) @@ -752,12 +752,14 @@ thread:d("%THREAD_AGAINST threw an error!\n%s\n", traceback(co, tostring(result))); thread:close(timeouts, result); + current = nil; elseif status(co) == "suspended" then if result == NSE_YIELD_VALUE then waiting[co] = thread; else thread:d("%THREAD yielded unexpectedly and cannot be rerun."); thread:close(); + current = nil; end elseif status(co) == "dead" then all[co] = nil; @@ -772,6 +774,7 @@ end thread:d("Finished %THREAD_AGAINST."); thread:close(timeouts); + current = nil; end end