summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehw/tdehardwaredevices.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2017-09-23 18:40:41 +0200
committerSlávek Banko <slavek.banko@axis.cz>2017-09-23 18:40:41 +0200
commit051acc7df5ff02d7bb1ad92b9be95efdc553d6c0 (patch)
tree2f6162fb6fa46369b71deee34ab397e2064c1067 /tdecore/tdehw/tdehardwaredevices.cpp
parent4dd179aaa3f53335428c2fda5b3d356d19349f28 (diff)
downloadtdelibs-051acc7df5ff02d7bb1ad92b9be95efdc553d6c0.tar.gz
tdelibs-051acc7df5ff02d7bb1ad92b9be95efdc553d6c0.zip
Fix crash in tdehwlib if /sys/devices/system/cpu/cpu* is not accessible
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'tdecore/tdehw/tdehardwaredevices.cpp')
-rw-r--r--tdecore/tdehw/tdehardwaredevices.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp
index a4e352d60..1d8a4280b 100644
--- a/tdecore/tdehw/tdehardwaredevices.cpp
+++ b/tdecore/tdehw/tdehardwaredevices.cpp
@@ -863,9 +863,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());
+ }
}
}