Skip to content

Commit

Permalink
[sensorfwd] Fixes MER#1170 fix crash in internal compass
Browse files Browse the repository at this point in the history
with no orientation sensor, do no try to access null object.
  • Loading branch information
lpotter committed Jul 16, 2015
1 parent 2575a2f commit 476cb6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chains/compasschain/compasschain.cpp
Expand Up @@ -45,7 +45,7 @@ CompassChain::CompassChain(const QString& id) :

if (sm.getAdaptorTypes().contains("orientationadaptor")) {
orientAdaptor = sm.requestDeviceAdaptor("orientationadaptor");
if (orientAdaptor->isValid()) {
if (orientAdaptor && orientAdaptor->isValid()) {
hasOrientationAdaptor = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion chains/magcalibrationchain/magcalibrationchain.cpp
Expand Up @@ -71,7 +71,7 @@ MagCalibrationChain::MagCalibrationChain(const QString& id) :

if (sm.getAdaptorTypes().contains("orientationadaptor")) {
DeviceAdaptor *orientAdaptor = sm.requestDeviceAdaptor("orientationadaptor");
if (orientAdaptor->isValid()) {
if (orientAdaptor && orientAdaptor->isValid()) {
needsCalibration = false;
}
}
Expand Down

0 comments on commit 476cb6c

Please sign in to comment.