Skip to content

Commit 513726b

Browse files
committed
feat: Add unreachable warning for when settings cannot be initialized
This will protect us in the event of a regression.
1 parent 2a7cd9b commit 513726b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/core/settings.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,13 @@ bool Settings::hasLsp() const
234234
void Settings::loadKnutSettings()
235235
{
236236
QFile file(":/core/settings.json");
237-
if (file.open(QIODevice::ReadOnly))
237+
if (file.open(QIODevice::ReadOnly)) {
238238
m_settings = nlohmann::json::parse(file.readAll().constData());
239+
return;
240+
}
241+
spdlog::error("{}: {} - is missing from Qt Resources and thus settings cannot be initialized", FUNCTION_NAME,
242+
file.fileName());
243+
Q_UNREACHABLE();
239244
}
240245

241246
void Settings::saveSettings()

0 commit comments

Comments
 (0)