diff options
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/commands.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index fa4ea6767..a91e6f244 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -90,8 +90,11 @@ static std::string getNick(const InputEvent &event) std::string args = event.args; if (args.empty()) { - WhisperTab *const whisper = dynamic_cast<WhisperTab* const>(event.tab); - if (!whisper || whisper->getNick().empty()) + if (!event.tab || event.tab->getType() != ChatTabType::WHISPER) + return std::string(); + + WhisperTab *const whisper = static_cast<WhisperTab* const>(event.tab); + if (whisper->getNick().empty()) { if (event.tab) { |