summaryrefslogtreecommitdiff
path: root/src/gpm-statistics.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-01-07 20:43:46 +0300
committermonsta <[email protected]>2017-01-24 12:04:36 +0300
commitb850b99bcdb120b89b354280f2816587ea6b7611 (patch)
treef9e7617b709921c226c2740b79bb6f5a278ab189 /src/gpm-statistics.c
parenta1de9e1967d4be7d90d2bf8ce752283e2dc062af (diff)
downloadmate-power-manager-b850b99bcdb120b89b354280f2816587ea6b7611.tar.bz2
mate-power-manager-b850b99bcdb120b89b354280f2816587ea6b7611.tar.xz
statistics: don't call upower function on a NULL device path
fixes https://github.com/mate-desktop/mate-power-manager/issues/139
Diffstat (limited to 'src/gpm-statistics.c')
-rw-r--r--src/gpm-statistics.c4
1 files changed, 4 insertions, 0 deletions
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);