diff --git a/gdbsupport/gdb-checked-static-cast.h b/gdbsupport/gdb-checked-static-cast.h index cc298733fad..bc75244bddd 100644 --- a/gdbsupport/gdb-checked-static-cast.h +++ b/gdbsupport/gdb-checked-static-cast.h @@ -54,6 +54,9 @@ checked_static_cast (V *v) "types must be related"); #ifdef DEVELOPMENT + if (v == nullptr) + return nullptr; + T result = dynamic_cast (v); gdb_assert (result != nullptr); #else