From faf26f39398cc5eb47e0c6813851d1ff89c8b022 Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Wed, 13 Apr 2016 18:33:04 +0000 Subject: [PATCH] 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 98294467553fe4dd766419c4e5aa6bc9502d65c7. Also see #12649. --- src/common/datavcmn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index d2ab84197f..a7f0ae1f0d 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -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;