Commit 39cc76d4 authored by Ghislain MARY's avatar Ghislain MARY

Fix crashes when starting the application if no linphonerc file exists yet.

parent dd84961b
......@@ -71,7 +71,7 @@ void Colors::overrideColors (const shared_ptr<linphone::Config> &config) {
for (int i = info->propertyOffset(); i < info->propertyCount(); ++i) {
const QMetaProperty metaProperty = info->property(i);
const string colorName = metaProperty.name();
const string colorValue = config->getString(COLORS_SECTION, colorName, "");
const string colorValue = config ? config->getString(COLORS_SECTION, colorName, "") : "";
if (!colorValue.empty())
setProperty(colorName.c_str(), QColor(::Utils::coreStringToAppString(colorValue)));
......
......@@ -773,11 +773,11 @@ void SettingsModel::setLogsEmail (const QString &email) {
// ---------------------------------------------------------------------------
QString SettingsModel::getLogsFolder (const shared_ptr<linphone::Config> &config) {
return ::Utils::coreStringToAppString(
config->getString(UI_SECTION, "logs_folder", Paths::getLogsDirPath())
);
return ::Utils::coreStringToAppString(config
? config->getString(UI_SECTION, "logs_folder", Paths::getLogsDirPath())
: Paths::getLogsDirPath());
}
bool SettingsModel::getLogsEnabled (const shared_ptr<linphone::Config> &config) {
return config->getInt(UI_SECTION, "logs_enabled", false);
return config ? config->getInt(UI_SECTION, "logs_enabled", false) : false;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment