From ae4029805054c033dcaa01fffb3bb84b0e9ff306 Mon Sep 17 00:00:00 2001 From: monsta Date: Sat, 7 Jan 2017 20:43:46 +0300 Subject: statistics: don't call upower function on a NULL device path fixes https://github.com/mate-desktop/mate-power-manager/issues/139 --- src/gpm-statistics.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c index af24fbb..d6bcaf1 100644 --- a/src/gpm-statistics.c +++ b/src/gpm-statistics.c @@ -1128,6 +1128,10 @@ static void gpm_stats_button_update_ui (void) { UpDevice *device; + + if (current_device == NULL) + return; + device = up_device_new (); up_device_set_object_path_sync (device, current_device, NULL, NULL); gpm_stats_update_info_data (device); -- cgit v1.2.1