mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-10-26 03:03:45 +01:00 
			
		
		
		
	Avoid JSON corruption when storage full (#2089)
This commit is contained in:
		| @@ -1454,8 +1454,10 @@ class AppsProvider with ChangeNotifier { | ||||
|         app = getCorrectedInstallStatusAppIfPossible(app, info) ?? app; | ||||
|       } | ||||
|       if (!onlyIfExists || this.apps.containsKey(app.id)) { | ||||
|         File('${(await getAppsDir()).path}/${app.id}.json') | ||||
|             .writeAsStringSync(jsonEncode(app.toJson())); | ||||
|         String filePath = '${(await getAppsDir()).path}/${app.id}.json'; | ||||
|         File('$filePath.tmp') | ||||
|             .writeAsStringSync(jsonEncode(app.toJson())); // #2089 | ||||
|         File('$filePath.tmp').renameSync(filePath); | ||||
|       } | ||||
|       try { | ||||
|         this.apps.update(app.id, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user