From 0641adc5f414d189adce0b5608c2774fc2496e23 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 9 Aug 2017 10:47:01 +0200 Subject: [PATCH] Segfault fixed --- companion/src/eeprominterface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index 0d6844642..430505365 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -729,7 +729,7 @@ QString RawSwitch::toString(Board::Type board, const GeneralSettings * const gen return QObject::tr("One"); case SWITCH_TYPE_FLIGHT_MODE: - return getElementName(QCoreApplication::translate("Flight mode", "FM"), index - 1, modelData->flightModeData[index-1].name); + return getElementName(QCoreApplication::translate("Flight mode", "FM"), index - 1, modelData ? modelData->flightModeData[index-1].name : NULL); case SWITCH_TYPE_NONE: return QObject::tr("----"); @@ -738,7 +738,7 @@ QString RawSwitch::toString(Board::Type board, const GeneralSettings * const gen return CHECK_IN_ARRAY(timerModes, index); case SWITCH_TYPE_SENSOR: - return getElementName(QCoreApplication::translate("Telemetry", "TELE"), index, modelData->sensorData[index-1].label); + return getElementName(QCoreApplication::translate("Telemetry", "TELE"), index, modelData ? modelData->sensorData[index-1].label : NULL); case SWITCH_TYPE_TELEMETRY: return QObject::tr("Telemetry");