mirror of https://github.com/vector-im/riot-web
Fix slash commands null guard
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
58532f2ac4
commit
8480d387cc
|
@ -1049,7 +1049,7 @@ export function parseCommandString(input) {
|
||||||
// trim any trailing whitespace, as it can confuse the parser for
|
// trim any trailing whitespace, as it can confuse the parser for
|
||||||
// IRC-style commands
|
// IRC-style commands
|
||||||
input = input.replace(/\s+$/, '');
|
input = input.replace(/\s+$/, '');
|
||||||
if (input[0] !== '/') return null; // not a command
|
if (input[0] !== '/') return {}; // not a command
|
||||||
|
|
||||||
const bits = input.match(/^(\S+?)(?: +((.|\n)*))?$/);
|
const bits = input.match(/^(\S+?)(?: +((.|\n)*))?$/);
|
||||||
let cmd;
|
let cmd;
|
||||||
|
|
Loading…
Reference in New Issue