diff options
author | Slávek Banko <[email protected]> | 2017-09-23 18:40:41 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2017-09-23 18:40:56 +0200 |
commit | 7d83a0cb922982e1ef6f3409b8ca1f3dd7ede110 (patch) | |
tree | 2b356ee89cb0d027e4102c9e50efd564d626aa1c /tdecore/tdehw/tdehardwaredevices.cpp | |
parent | 03781b6f47464cacb1d792c2b3580ffee367c3b0 (diff) | |
download | tdelibs-7d83a0cb922982e1ef6f3409b8ca1f3dd7ede110.tar.gz tdelibs-7d83a0cb922982e1ef6f3409b8ca1f3dd7ede110.zip |
Fix crash in tdehwlib if /sys/devices/system/cpu/cpu* is not accessible
Signed-off-by: Slávek Banko <[email protected]>
(cherry picked from commit 051acc7df5ff02d7bb1ad92b9be95efdc553d6c0)
Diffstat (limited to 'tdecore/tdehw/tdehardwaredevices.cpp')
-rw-r--r-- | tdecore/tdehw/tdehardwaredevices.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp index 7449bf758..95261d0a9 100644 --- a/tdecore/tdehw/tdehardwaredevices.cpp +++ b/tdecore/tdehw/tdehardwaredevices.cpp @@ -862,9 +862,11 @@ void TDEHardwareDevices::processModifiedCPUs() { if (modified) { for (processorNumber=0; processorNumber<processorCount; processorNumber++) { TDEGenericDevice* hwdevice = findCPUBySystemPath(TQString("/sys/devices/system/cpu/cpu%1").arg(processorNumber)); - // Signal new information available - emit hardwareUpdated(hwdevice); - emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID()); + if (hwdevice) { + // Signal new information available + emit hardwareUpdated(hwdevice); + emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID()); + } } } |