fix: Panic while trying to clear old diagnostics while there's nothing

This commit is contained in:
Shoyu Vanilla 2025-08-12 00:24:44 +09:00
parent 3d2c40d705
commit 8af9607d28

View File

@ -105,7 +105,7 @@ impl DiagnosticCollection {
flycheck_id: usize,
generation: DiagnosticsGeneration,
) {
if self.check[flycheck_id].generation < generation {
if self.check.get(flycheck_id).is_some_and(|it| it.generation < generation) {
self.clear_check(flycheck_id);
}
}