wesnothd: check for possible null optional in error message

This commit is contained in:
loonycyborg 2021-10-26 20:34:39 +03:00
parent 9a1b4caa55
commit 80015e78c0

View file

@ -971,7 +971,7 @@ bool game::process_turn(simple_wml::document& data, player_iterator user)
std::stringstream msg;
msg << "Removing illegal command '" << (*command).first_child().to_string() << "' from: " << username(user)
<< ". Current player is: " << username(*current_player()) << " (" << current_side_index_ + 1 << "/" << nsides_
<< ". Current player is: " << (current_player() ? username(*current_player()) : "<none>") << " (" << current_side_index_ + 1 << "/" << nsides_
<< ").";
LOG_GAME << msg.str() << " (game id: " << id_ << ", " << db_id_ << ")\n";
send_and_record_server_message(msg.str());