From 639cf20a738c5ba7dd137e7ca8250733d8a33e98 Mon Sep 17 00:00:00 2001 From: gfgtdf Date: Mon, 30 Apr 2018 22:24:51 +0200 Subject: [PATCH] wb: fix nullptr assertion when log is enabled --- src/whiteboard/move.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/whiteboard/move.cpp b/src/whiteboard/move.cpp index a6971e039376..2658edb10a44 100644 --- a/src/whiteboard/move.cpp +++ b/src/whiteboard/move.cpp @@ -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; }