diff --git a/src/os2/slider.cpp b/src/os2/slider.cpp index 0a6eb8f985..312d9743c9 100644 --- a/src/os2/slider.cpp +++ b/src/os2/slider.cpp @@ -863,8 +863,10 @@ void wxSlider::GetSize( wxFindMaxSize( m_hStaticValue ,&vRect ); - *pnWidth = vRect.xRight - vRect.xLeft; - *pnHeight = vRect.yBottom - vRect.yTop; + if (pnWidth) + *pnWidth = vRect.xRight - vRect.xLeft; + if (pnHeight) + *pnHeight = vRect.yTop - vRect.yBottom; } // end of wxSlider::GetSize int wxSlider::GetThumbLength() const