diff options
author | Milan Crha <mcrha@redhat.com> | 2014-07-21 21:53:32 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2014-07-21 21:53:32 +0800 |
commit | 8d2e1340cf46d0e630448c5f9fe4ed02229cd06b (patch) | |
tree | a48affaa26ff0fffcf8037055cd560ae06c00ac8 | |
parent | fc55dedaf1c3d00d6b4e117d988f2bafe2ca791f (diff) | |
download | gsoc2013-evolution-8d2e1340cf46d0e630448c5f9fe4ed02229cd06b.tar gsoc2013-evolution-8d2e1340cf46d0e630448c5f9fe4ed02229cd06b.tar.gz gsoc2013-evolution-8d2e1340cf46d0e630448c5f9fe4ed02229cd06b.tar.bz2 gsoc2013-evolution-8d2e1340cf46d0e630448c5f9fe4ed02229cd06b.tar.lz gsoc2013-evolution-8d2e1340cf46d0e630448c5f9fe4ed02229cd06b.tar.xz gsoc2013-evolution-8d2e1340cf46d0e630448c5f9fe4ed02229cd06b.tar.zst gsoc2013-evolution-8d2e1340cf46d0e630448c5f9fe4ed02229cd06b.zip |
e_day_view_show_popup_menu: Avoid runtime warning from tooltip_get_view_event
The e_day_view_show_popup_menu() can be called with event_num = -1,
which is when the mouse doesn't hover above any event. The function
tooltip_get_view_event() claims a runtime warning in this case, thus
avoid it by properly testing the passed-in value.
-rw-r--r-- | calendar/gui/e-day-view.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 8f09d27a5b..9950da6566 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -4502,7 +4502,10 @@ e_day_view_show_popup_menu (EDayView *day_view, gint day, gint event_num) { - EDayViewEvent *pevent = tooltip_get_view_event (day_view, day, event_num); + EDayViewEvent *pevent = NULL; + + if (event_num >= 0) + pevent = tooltip_get_view_event (day_view, day, event_num); if (pevent && pevent->canvas_item) tooltip_destroy (day_view, pevent->canvas_item); |