Bug Fix: App crashes on IRC command when no param is provided

This commit is contained in:
giomfo
2016-07-01 17:06:20 +02:00
parent 08dd072542
commit 837b144265
+10 -3
View File
@@ -622,9 +622,16 @@
if ([string hasPrefix:kCmdJoinRoom])
{
// Join a room
NSString *roomAlias = [string substringFromIndex:kCmdJoinRoom.length + 1];
// Remove white space from both ends
roomAlias = [roomAlias stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
NSString *roomAlias;
// Sanity check
if (string.length > kCmdJoinRoom.length)
{
roomAlias = [string substringFromIndex:kCmdJoinRoom.length + 1];
// Remove white space from both ends
roomAlias = [roomAlias stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
}
// Check
if (roomAlias.length)