summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/src/msgs.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index a4f660f131..ebbf106d86 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -343,13 +343,6 @@ static INT_PTR GetWindowClass(WPARAM wParam, LPARAM lParam)
static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam)
{
- StatusTextData *st = (StatusTextData*)lParam;
- if (st == NULL)
- return 1;
-
- if (st->cbSize != sizeof(StatusTextData))
- return 1;
-
HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, wParam);
if (hwnd == NULL)
return 1;
@@ -358,8 +351,13 @@ static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam)
if (dat == NULL)
return 1;
- SendMessage(dat->hwndStatus, SB_SETICON, 0, (LPARAM)st->hIcon);
- SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)st->tszText);
+ StatusTextData *st = (StatusTextData*)lParam;
+ if (st != NULL && st->cbSize != sizeof(StatusTextData))
+ return 1;
+
+ SendMessage(dat->hwndStatus, SB_SETICON, 0, (LPARAM)(st == NULL ? 0 : st->hIcon));
+ SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)(st == NULL ? _T("") : st->tszText));
+
return 0;
}