mcbot/cmds/dict.lua
changeset 42 99477d3c2dda
parent 16 064a50911e05
child 66 d9c00a9fe9d5
--- a/mcbot/cmds/dict.lua	Sun May 16 13:43:31 2010 +0200
+++ b/mcbot/cmds/dict.lua	Tue Jun 01 16:41:49 2010 +0200
@@ -11,7 +11,7 @@
     local fh = io.popen(cmd)
     result = fh:read("*a")  -- read dict output
     fh:close()
-    if result:match("^$") then return nil, "dict: No output" end
+    if not result or result:match("^$") then return nil, "dict: No output" end
 
     -- Sometimes dict outpur is ugly... Let's filter out whitespace.
     result = result:gsub("[ \t]+\n", "\n"):gsub("\n\n\n+", "\n\n")