aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@embedded.pro>2016-08-07 20:38:55 +0200
committerJoel Bodenmann <joel@embedded.pro>2016-08-07 20:38:55 +0200
commit0c695b2471c347847e579aa19ada5612341bfc2d (patch)
tree991dbf00d682eec053758544410a2ab6febe38e3
parent91f537c91ca877f03a3634e7de9423fe451ff06a (diff)
downloaduGFX-0c695b2471c347847e579aa19ada5612341bfc2d.tar.gz
uGFX-0c695b2471c347847e579aa19ada5612341bfc2d.tar.bz2
uGFX-0c695b2471c347847e579aa19ada5612341bfc2d.zip
Fixing crash when passing NULL to gwinSetStyle()
-rw-r--r--docs/releases.txt1
-rw-r--r--src/gwin/gwin_widget.c4
2 files changed, 3 insertions, 2 deletions
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);
}