diff --git a/src/motif/scrolbar.cpp b/src/motif/scrolbar.cpp index 5b19681cf3..6cbdf29c23 100644 --- a/src/motif/scrolbar.cpp +++ b/src/motif/scrolbar.cpp @@ -125,6 +125,8 @@ static void wxScrollBarCallback(Widget widget, XtPointer clientData, XmScaleCallbackStruct *cbs) { wxScrollBar *scrollBar = (wxScrollBar*)wxGetWindowFromTable(widget); + wxCHECK_RET( scrollBar, _T("invalid widget in scrollbar callback") ); + wxOrientation orientation = (wxOrientation)wxPtrToUInt(clientData); wxEventType eventType = wxEVT_NULL; diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 66428802a9..a99a8bb706 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -2088,6 +2088,8 @@ static void wxScrollBarCallback(Widget scrollbar, XmScrollBarCallbackStruct *cbs) { wxWindow *win = wxGetWindowFromTable(scrollbar); + wxCHECK_RET( win, _T("invalid widget in scrollbar callback") ); + wxOrientation orientation = (wxOrientation)wxPtrToUInt(clientData); wxEventType eventType = wxEVT_NULL;