Fix crash on startup

This commit is contained in:
Matti Viljanen 2020-04-26 10:27:51 +03:00
parent cbf7e7cdbc
commit 6beba35d0f
No known key found for this signature in database
GPG key ID: CF32A1495158F888

View file

@ -82,10 +82,10 @@ Battery::Battery(Settings* newSettings, QObject* parent) : QObject(parent)
chargingEnabledFile->close();
}
else {
delete chargingEnabledFile;
chargingEnabledFile = Q_NULLPTR;
qWarning() << "Charger control file" << chargingEnabledFile->fileName() << "is not writable";
qWarning() << "Charger control feature disabled";
delete chargingEnabledFile;
chargingEnabledFile = Q_NULLPTR;
}
}