Skip to content

Commit b49b452

Browse files
committed
Avoid crashing when no preferences have been stored so far.
1 parent 5ba5bbe commit b49b452

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

client_server/DocumentThread.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ DocumentThread::Prefs::Prefs(bool use_defaults)
203203
if (f)
204204
f >> data;
205205
else {
206+
data = nlohmann::json::object();
207+
206208
// Backwards compatibility, check to see if cadabra.conf exists
207209
// and if so take the is_registered variable from there
208210
std::ifstream old_f(std::string(Glib::get_user_config_dir()) + "/cadabra.conf");

0 commit comments

Comments
 (0)