Skip to content
Permalink
Browse files

Common/MsgHandler: Brace if statement in MsgAlert

The condition travels more than one line, so the body should be braced.
While we're at it, make the comparison against nullptr explicit.
  • Loading branch information...
lioncash committed Jun 19, 2019
1 parent 0eddf6d commit e7dd46a531c342ee3e041de2e1edc96a123ee5dd
Showing with 4 additions and 1 deletion.
  1. +4 −1 Source/Core/Common/MsgHandler.cpp
@@ -121,8 +121,11 @@ bool MsgAlert(bool yes_no, MsgType style, const char* format, ...)
ERROR_LOG(MASTER_LOG, "%s: %s", caption.c_str(), buffer);

// Don't ignore questions, especially AskYesNo, PanicYesNo could be ignored
if (s_msg_handler && (s_alert_enabled || style == MsgType::Question || style == MsgType::Critical))
if (s_msg_handler != nullptr &&
(s_alert_enabled || style == MsgType::Question || style == MsgType::Critical))
{
return s_msg_handler(caption.c_str(), buffer, yes_no, style);
}

return true;
}

0 comments on commit e7dd46a

Please sign in to comment.
You can’t perform that action at this time.