don't die on a bad filename to dcc.send()

master
jluehrs2 2007-09-04 18:47:18 -05:00
parent 21a59a8e39
commit 6980eab676
1 changed files with 6 additions and 1 deletions

View 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',