diff --git a/src/handlers/event/analyze_logs/issues.rs b/src/handlers/event/analyze_logs/issues.rs index 2f77d43..5bee861 100644 --- a/src/handlers/event/analyze_logs/issues.rs +++ b/src/handlers/event/analyze_logs/issues.rs @@ -39,6 +39,7 @@ pub async fn find(log: &str, data: &Data) -> Result> { spark_macos, xrandr, folder_name, + corrupted_instance, ]; let mut res: Vec<(String, String)> = issues.iter().filter_map(|issue| issue(log)).collect(); @@ -497,3 +498,15 @@ fn folder_name(log: &str) -> Issue { found.then_some(issue) } + +fn corrupted_instance(log: &str) -> Issue { + let issue = ( + "Corrupted instance files".to_string(), + "Your instance's `mmc-pack.json` appears to be corrupted. Make a new instance and copy over your data between `.minecraft` folders. To prevent this in the future, ensure your system has sufficient disk space and avoid forcefully shutting down your PC." + .to_string(), + ); + + let found = log.contains("mmc-pack.json as json: illegal value"); + + found.then_some(issue) +}