diff --git a/src/motif/window.cpp b/src/motif/window.cpp index e51b353f98..3d778a7fa6 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -817,8 +817,9 @@ int wxWindow::GetScrollRange(int orient) const Widget scrollBar = (Widget)GetScrollbar((wxOrientation)orient); wxCHECK_MSG( scrollBar, 0, "no such scrollbar" ); - int range; - XtVaGetValues(scrollBar, XmNmaximum, &range, NULL); + int range = 0; + if (scrollBar) + XtVaGetValues(scrollBar, XmNmaximum, &range, NULL); return range; }