Skip to content

Commit

Permalink
wb: fix nullptr assertion when log is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed May 3, 2018
1 parent a7018d0 commit 639cf20
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/whiteboard/move.cpp
Expand Up @@ -57,8 +57,13 @@ std::ostream& operator<<(std::ostream &s, move_const_ptr move)

std::ostream& move::print(std::ostream &s) const
{
s << "Move for unit " << get_unit()->name() << " [" << get_unit()->id() << "] "
if(!get_unit()) {
s << "Move for unknown unit [" << unit_underlying_id_ << "] " << "from (" << get_source_hex() << ") to (" << get_dest_hex() << ")";
}
else {
s << "Move for unit " << get_unit()->name() << " [" << get_unit()->id() << "] "
<< "from (" << get_source_hex() << ") to (" << get_dest_hex() << ")";
}
return s;
}

Expand Down

0 comments on commit 639cf20

Please sign in to comment.