test for pen validity before calling GetStyle() on it, this asserts now if the pen is invalid

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53150 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-04-12 21:07:19 +00:00
parent e3d8295c33
commit 23648cb34c

View File

@ -948,7 +948,7 @@ void wxMSWDCImpl::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord h
// (i.e. drawn with a transparent pen) one pixel smaller in both directions
// and we want them to have the same size regardless of which pen is used
#ifndef __WXWINCE__
if ( m_pen.GetStyle() == wxPENSTYLE_TRANSPARENT )
if ( m_pen.IsOk() && m_pen.GetStyle() == wxPENSTYLE_TRANSPARENT )
{
x2dev++;
y2dev++;