Fix crash when using default wxDataViewEvent ctor

Check the value of the wxDataViewCtrl pointer parameter in Init() instead
of unconditionally calling GetModel() on it. The default ctor of
wxDataViewEvent calls Init() with a null pointer.

This fixes the failing GUI tests with the XP buildbot slave.

Regression since 9829446755.

Also see #12649.
This commit is contained in:
Dimitri Schoolwerth
2016-04-13 18:33:04 +00:00
parent adfc3c18c3
commit faf26f3939

View File

@@ -1612,7 +1612,7 @@ void wxDataViewEvent::Init(wxDataViewCtrlBase* dvc,
{
m_item = item;
m_col = column ? column->GetModelColumn() : -1;
m_model = dvc->GetModel();
m_model = dvc ? dvc->GetModel() : NULL;
m_column = column;
m_pos = wxDefaultPosition;
m_cacheFrom = 0;