From 9de512857be273ddfedd18591130269c181542ed Mon Sep 17 00:00:00 2001 From: "silver%warwickcompsoc.co.uk" Date: Thu, 20 Jul 2006 14:48:06 +0000 Subject: [PATCH] Bug 342852 - Display an error if only "/" entered, instead of throwing a JS exception. ChatZilla only. r=samuel git-svn-id: svn://10.0.0.236/trunk@203250 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/extensions/irc/xul/content/commands.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mozilla/extensions/irc/xul/content/commands.js b/mozilla/extensions/irc/xul/content/commands.js index 479c0a4acef..1f0b2e26fac 100644 --- a/mozilla/extensions/irc/xul/content/commands.js +++ b/mozilla/extensions/irc/xul/content/commands.js @@ -354,6 +354,12 @@ function dispatch(text, e, isInteractive, flags) /* split command from arguments */ var ary = text.match(/(\S+) ?(.*)/); + if (!ary) + { + display(getMsg(MSG_ERR_NO_COMMAND, "")); + return null; + } + e.commandText = ary[1]; if (ary[2]) e.inputData = stringTrim(ary[2]);