jid.split(): Return nil when passed nil

Tue, 30 Sep 2008 19:49:36 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 30 Sep 2008 19:49:36 +0100
changeset 29
b847875801e5
parent 28
4a238233f278
child 30
bcf539295f2d

jid.split(): Return nil when passed nil

util/jid.lua file | annotate | diff | comparison | revisions
--- a/util/jid.lua	Sat Sep 27 19:18:05 2008 +0100
+++ b/util/jid.lua	Tue Sep 30 19:49:36 2008 +0100
@@ -4,6 +4,7 @@
 module "jid"
 
 function split(jid)
+	if not jid then return nil; end
 	local node = match(jid, "^([^@]+)@");
 	local server = (node and match(jid, ".-@([^@/]+)")) or match(jid, "^([^@/]+)");
 	local resource = match(jid, "/(.+)$");

mercurial