diff --git a/src/modules/upower.cpp b/src/modules/upower.cpp index 7f0b3446..69e5b79e 100644 --- a/src/modules/upower.cpp +++ b/src/modules/upower.cpp @@ -370,6 +370,8 @@ void UPower::setDisplayDevice() { auto thisPtr{static_cast(user_data)}; upDevice.upDevice = static_cast(data); thisPtr->getUpDeviceInfo(upDevice); + if (upDevice.nativePath == nullptr) + return; if (0 == std::strcmp(upDevice.nativePath, thisPtr->nativePath_.c_str())) { // Unref current upDevice if (thisPtr->upDevice_.upDevice != NULL) g_object_unref(thisPtr->upDevice_.upDevice);