summaryrefslogtreecommitdiff
blob: 7f8981a006e2125536c01668120afa9cc6df1f80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
This patch is required to fix a segfault on startup in <=0.22.1 if star catalogue files are
added or removed (USE=stars)

Refer: https://github.com/Stellarium/stellarium/issues/2404

This patch may be safely removed for 0.22.2 - it has been patched upstream.

--- a/src/core/modules/StarMgr.cpp
+++ b/src/core/modules/StarMgr.cpp
@@ -592,13 +592,13 @@ void StarMgr::setCheckFlag(const QString& catId, bool b)
 			return;
 		m["checked"]=b;
 		catalogsDescription[idx-1]=m;
-		starSettings["catalogs"]=catalogsDescription;
-		QFile tmp(starConfigFileFullPath);
-		if(tmp.open(QIODevice::WriteOnly))
-		{
-			StelJsonParser::write(starSettings, &tmp);
-			tmp.close();
-		}
+	}
+	starSettings["catalogs"]=catalogsDescription;
+	QFile tmp(starConfigFileFullPath);
+	if(tmp.open(QIODevice::WriteOnly))
+	{
+		StelJsonParser::write(starSettings, &tmp);
+		tmp.close();
 	}
 }