X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/de67922eaaf69aee61a3bda72e773ed0ac8b691b..bca35e84c0a22af6567d260cfddef0a698858e3c:/src/generic/datavgen.cpp diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 5c39027e6b..a13797b3f6 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -1565,6 +1565,13 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) // compute which columns needs to be redrawn unsigned int cols = GetOwner()->GetColumnCount(); + if ( !cols ) + { + // we assume that we have at least one column below and painting an + // empty control is unnecessary anyhow + return; + } + unsigned int col_start = 0; unsigned int x_start; for (x_start = 0; col_start < cols; col_start++)