diff --git a/docs/rh-log.txt b/docs/rh-log.txt index feffba4a5..20d219f39 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,5 @@ July 16, 2009 +- Added a NULL screen check when detaching HUD messages. - Added HotWax's A_SetArg. - Gez's patch for more A_WeaponReady flags: * WRF_NOBOB (1): Weapon won't bob diff --git a/src/g_shared/shared_sbar.cpp b/src/g_shared/shared_sbar.cpp index 0a385591c..1bbe490ca 100644 --- a/src/g_shared/shared_sbar.cpp +++ b/src/g_shared/shared_sbar.cpp @@ -381,7 +381,10 @@ DHUDMessage *DBaseStatusBar::DetachMessage (DHUDMessage *msg) *prev = probe->Next; probe->Next = NULL; // Redraw the status bar in case it was covered - SB_state = screen->GetPageCount (); + if (screen != NULL) + { + SB_state = screen->GetPageCount(); + } } return probe; } @@ -401,7 +404,10 @@ DHUDMessage *DBaseStatusBar::DetachMessage (DWORD id) *prev = probe->Next; probe->Next = NULL; // Redraw the status bar in case it was covered - SB_state = screen->GetPageCount (); + if (screen != NULL) + { + SB_state = screen->GetPageCount(); + } } return probe; }