From 96cec5349a40bb55b9c65e19234234d2ab197b48 Mon Sep 17 00:00:00 2001 From: inmarket Date: Thu, 1 May 2014 13:54:38 +1000 Subject: [PATCH] Prevent gwinGetStyle() being called on a non-widget --- src/gwin/gwidget.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gwin/gwidget.c b/src/gwin/gwidget.c index ad2b7b20..181b7425 100644 --- a/src/gwin/gwidget.c +++ b/src/gwin/gwidget.c @@ -371,6 +371,9 @@ void gwinSetStyle(GHandle gh, const GWidgetStyle *pstyle) { } const GWidgetStyle *gwinGetStyle(GHandle gh) { + if (!(gh->flags & GWIN_FLG_WIDGET)) + return 0; + return gw->pstyle; }