summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-01-07 20:43:46 +0300
committermonsta <[email protected]>2017-01-07 20:43:46 +0300
commitae4029805054c033dcaa01fffb3bb84b0e9ff306 (patch)
treee8557de1fe93cc96dc28c48a65dd3f144b13730b
parent834d45754cc6ff017706037201faf8ac32a65bab (diff)
downloadmate-power-manager-ae4029805054c033dcaa01fffb3bb84b0e9ff306.tar.bz2
mate-power-manager-ae4029805054c033dcaa01fffb3bb84b0e9ff306.tar.xz
statistics: don't call upower function on a NULL device path
fixes https://github.com/mate-desktop/mate-power-manager/issues/139
-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 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);