]> git.lizzy.rs Git - luairc.git/commitdiff
don't die on a bad filename to dcc.send()
authorjluehrs2 <jluehrs2@uiuc.edu>
Tue, 4 Sep 2007 23:47:18 +0000 (18:47 -0500)
committerjluehrs2 <jluehrs2@uiuc.edu>
Tue, 4 Sep 2007 23:47:18 +0000 (18:47 -0500)
src/irc/dcc.lua

index be8892b02ac85f80a671674104058746baeef64a..1545d712aaac20f17bbd1a8f0dbaa1f67c14eb4a 100644 (file)
@@ -174,7 +174,12 @@ function send(nick, filename, port)
     base.assert(err, msg)
     base.assert(sock:listen(1))
     local ip = misc._ip_str_to_int(irc.get_ip())
-    local file = base.assert(io.open(filename))
+    local file, err = io.open(filename)
+    if not file then
+        irc_debug._warn(err)
+        sock:close()
+        return
+    end
     local size = file:seek("end")
     file:seek("set")
     irc._register_socket(sock, 'r',