From 5324cd9abdf34c6568c7051a97c33a8934fcd89b Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 3 Apr 2014 19:08:02 +0100 Subject: Fix cppcheck nullPointer --- amiga/theme.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/amiga/theme.c b/amiga/theme.c index 0da15acee..e00e08090 100644 --- a/amiga/theme.c +++ b/amiga/theme.c @@ -470,10 +470,10 @@ void gui_window_stop_throbber(struct gui_window *g) // g->shared->throbber_frame = 0; } -void ami_update_throbber(struct gui_window_2 *g,bool redraw) +void ami_update_throbber(struct gui_window_2 *g, bool redraw) { struct IBox *bbox; - int frame = g->throbber_frame; + int frame; if(!g) return; if(!g->objects[GID_THROBBER]) return; @@ -481,10 +481,12 @@ void ami_update_throbber(struct gui_window_2 *g,bool redraw) if(g->bw->window->throbbing == false) { frame = 0; - g->throbber_frame=1; + g->throbber_frame = 1; } else { + frame = g->throbber_frame; + if(!redraw) { if(g->throbber_update_count < throbber_update_interval) -- cgit v1.2.3