wb: fix nullptr assertion when log is enabled
This commit is contained in:
parent
195913fc4b
commit
00f90eabe6
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue