diff --git a/src/qt/pen.cpp b/src/qt/pen.cpp index e0313b6d1a..bf265dcd62 100644 --- a/src/qt/pen.cpp +++ b/src/qt/pen.cpp @@ -207,6 +207,8 @@ class wxPenRefData: public wxGDIRefData { m_qtPen.setCapStyle(Qt::RoundCap); m_qtPen.setJoinStyle(Qt::RoundJoin); + m_dashes = NULL; + m_dashesSize = 0; } wxPenRefData() @@ -307,8 +309,10 @@ void wxPen::SetDashes(int nb_dashes, const wxDash *dash) ((wxPenRefData *)m_refData)->m_dashesSize = nb_dashes; QVector dashes; - for (int i = 0; i < nb_dashes; i++) { - dashes << dash[i]; + if (dash) + { + for (int i = 0; i < nb_dashes; i++) + dashes << dash[i]; } M_PENDATA.setDashPattern(dashes);