aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-05-01 13:54:38 +1000
committerinmarket <andrewh@inmarket.com.au>2014-05-01 13:54:38 +1000
commit96cec5349a40bb55b9c65e19234234d2ab197b48 (patch)
tree31928725bbb835cfa47d03c9782f3f673f270536
parentcf548f0e9c8a13741489a6b3368da1f8040301e2 (diff)
downloaduGFX-96cec5349a40bb55b9c65e19234234d2ab197b48.tar.gz
uGFX-96cec5349a40bb55b9c65e19234234d2ab197b48.tar.bz2
uGFX-96cec5349a40bb55b9c65e19234234d2ab197b48.zip
Prevent gwinGetStyle() being called on a non-widget
-rw-r--r--src/gwin/gwidget.c3
1 files changed, 3 insertions, 0 deletions
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;
}