diff --git a/src/main/kotlin/org/arend/typechecking/error/ErrorService.kt b/src/main/kotlin/org/arend/typechecking/error/ErrorService.kt index d88d7f856..5f0ae752d 100644 --- a/src/main/kotlin/org/arend/typechecking/error/ErrorService.kt +++ b/src/main/kotlin/org/arend/typechecking/error/ErrorService.kt @@ -121,9 +121,11 @@ class ErrorService : ErrorReporter { val arendErrors = typecheckingErrors[file] ?: return emptyList() val list = ArrayList>() - for (arendError in arendErrors) { - arendError.cause?.let { - list.add(Pair(arendError.error, it)) + synchronized(arendErrors) { + for (arendError in arendErrors) { + arendError.cause?.let { + list.add(Pair(arendError.error, it)) + } } } return list