diff --git a/docs/releases.txt b/docs/releases.txt index 67ca1a0d..02b1359b 100644 --- a/docs/releases.txt +++ b/docs/releases.txt @@ -6,6 +6,7 @@ *** Changes after 2.6 *** FEATURE: Added EXC7200 driver FEATURE: Added STM32F439i-EVAL board files +FIX: Fixed crash when passing NULL to gwinSetStyle() *** Release 2.6 *** diff --git a/src/gwin/gwin_widget.c b/src/gwin/gwin_widget.c index 483a63b3..c3704536 100644 --- a/src/gwin/gwin_widget.c +++ b/src/gwin/gwin_widget.c @@ -588,8 +588,8 @@ void gwinSetStyle(GHandle gh, const GWidgetStyle *pstyle) { return; gw->pstyle = pstyle ? pstyle : defaultStyle; - gh->bgcolor = pstyle->background; - gh->color = pstyle->enabled.text; + gh->bgcolor = gw->pstyle->background; + gh->color = gw->pstyle->enabled.text; _gwinUpdate(gh); }