Skip to content

Commit

Permalink
Fix crash when using /unstable-set-user-color without any arguments (#…
Browse files Browse the repository at this point in the history
…4574)

I told you it was unstable
  • Loading branch information
pajlada authored Apr 22, 2023
1 parent 6d2605d commit 2ed6216
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/controllers/commands/CommandController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3190,14 +3190,16 @@ void CommandController::initialize(Settings &, Paths &paths)
"works in Twitch channels"));
return "";
}
auto userID = ctx.words.at(1);
if (ctx.words.size() < 2)
{
ctx.channel->addMessage(
makeSystemMessage(QString("Usage: %1 <TwitchUserID> [color]")
.arg(ctx.words.at(0))));
return "";
}

auto userID = ctx.words.at(1);

auto color = ctx.words.value(2);

getIApp()->getUserData()->setUserColor(userID, color);
Expand Down

0 comments on commit 2ed6216

Please sign in to comment.