Browse Source

Fixing crash when passing NULL to gwinSetStyle()

Joel Bodenmann 3 years ago
parent
commit
0c695b2471
2 changed files with 3 additions and 2 deletions
  1. 1 0
      docs/releases.txt
  2. 2 2
      src/gwin/gwin_widget.c

+ 1 - 0
docs/releases.txt

@@ -6,6 +6,7 @@
6 6
 *** Changes after 2.6 ***
7 7
 FEATURE:	Added EXC7200 driver
8 8
 FEATURE:	Added STM32F439i-EVAL board files
9
+FIX:		Fixed crash when passing NULL to gwinSetStyle()
9 10
 
10 11
 
11 12
 *** Release 2.6 ***

+ 2 - 2
src/gwin/gwin_widget.c

@@ -588,8 +588,8 @@ void gwinSetStyle(GHandle gh, const GWidgetStyle *pstyle) {
588 588
 		return;
589 589
 
590 590
 	gw->pstyle = pstyle ? pstyle : defaultStyle;
591
-	gh->bgcolor = pstyle->background;
592
-	gh->color = pstyle->enabled.text;
591
+	gh->bgcolor = gw->pstyle->background;
592
+	gh->color = gw->pstyle->enabled.text;
593 593
 
594 594
 	_gwinUpdate(gh);
595 595
 }