diff --git a/gtk/gtkstylecascade.c b/gtk/gtkstylecascade.c index 7a8950b0b0..7d947b2f60 100644 --- a/gtk/gtkstylecascade.c +++ b/gtk/gtkstylecascade.c @@ -50,12 +50,13 @@ gtk_style_cascade_iter_next (GtkStyleCascade *cascade, for (cas = cascade, ix = 0; ix < iter->n_cascades; cas = cas->parent, ix++) { GtkStyleProviderData *data; + if (iter->cascade_index[ix] <= 0) continue; data = &g_array_index (cas->providers, - GtkStyleProviderData, - iter->cascade_index[ix] - 1); + GtkStyleProviderData, + iter->cascade_index[ix] - 1); if (highest_priority_data == NULL || data->priority > highest_priority_data->priority) { highest_priority_index = ix;