diff options
| -rw-r--r-- | src/game/client/components/menus_ingame.cpp | 3 | ||||
| -rw-r--r-- | src/game/server/gamecontext.cpp | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index cdeae9a8..fbde9a0b 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -550,7 +550,8 @@ void CMenus::RenderServerControl(CUIRect MainView) Bottom.VSplitRight(120.0f, &Bottom, &Button); static int s_AddVoteButton = 0; if(DoButton_Menu(&s_AddVoteButton, Localize("Add"), 0, &Button)) - m_pClient->m_pVoting->AddvoteOption(s_aVoteDescription, s_aVoteCommand); + if(s_aVoteDescription[0] != 0 && s_aVoteCommand[0] != 0) + m_pClient->m_pVoting->AddvoteOption(s_aVoteDescription, s_aVoteCommand); Bottom.VSplitLeft(5.0f, 0, &Bottom); Bottom.VSplitLeft(250.0f, &Button, &Bottom); diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 8958833c..a0c1c64a 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -1072,7 +1072,9 @@ void CGameContext::ConAddVote(IConsole::IResult *pResult, void *pUserData) pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aBuf); return; } - if(str_length(pDescription) >= VOTE_DESC_LENGTH) + while(*pDescription && *pDescription == ' ') + pDescription++; + if(str_length(pDescription) >= VOTE_DESC_LENGTH || *pDescription == 0) { char aBuf[256]; str_format(aBuf, sizeof(aBuf), "skipped invalid option '%s'", pDescription); |