From b850b99bcdb120b89b354280f2816587ea6b7611 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(+) diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c index 21a0a52..b71a6f8 100644 --- a/src/gpm-statistics.c +++ b/src/gpm-statistics.c @@ -1131,6 +1131,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