diff --git a/src/msw/graphicsd2d.cpp b/src/msw/graphicsd2d.cpp index 9f4cd3ecf9..37c4e8db8a 100644 --- a/src/msw/graphicsd2d.cpp +++ b/src/msw/graphicsd2d.cpp @@ -2333,7 +2333,9 @@ public: protected: void DoAcquireResource() wxOVERRIDE { - HRESULT hr = GetContext()->CreateGradientStopCollection(m_gradientStops.data(), + wxCHECK_RET(!m_gradientStops.empty(), "No gradient stops provided"); + + HRESULT hr = GetContext()->CreateGradientStopCollection(&m_gradientStops[0], m_gradientStops.size(), D2D1_GAMMA_2_2, D2D1_EXTEND_MODE_CLAMP, &m_nativeResource); wxCHECK_HRESULT_RET(hr); }