summaryrefslogtreecommitdiffstats
path: root/tdecore
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:56 +0200
commit7d83a0cb922982e1ef6f3409b8ca1f3dd7ede110 (patch)
tree2b356ee89cb0d027e4102c9e50efd564d626aa1c /tdecore
parent03781b6f47464cacb1d792c2b3580ffee367c3b0 (diff)
downloadtdelibs-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 <slavek.banko@axis.cz> (cherry picked from commit 051acc7df5ff02d7bb1ad92b9be95efdc553d6c0)
Diffstat (limited to 'tdecore')
-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 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());
+ }
}
}