File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ import com.intellij.openapi.vfs.VirtualFile
44
44
import com.intellij.psi.PsiClass
45
45
import com.intellij.psi.PsiElement
46
46
import com.intellij.psi.PsiMethod
47
+ import com.intellij.util.application
47
48
import java.util.concurrent.ConcurrentHashMap
48
49
import javax.swing.Icon
49
50
import org.jetbrains.jps.model.java.JavaResourceRootType
@@ -231,18 +232,18 @@ class MinecraftFacet(
231
232
private class RefreshRootsException : Exception ()
232
233
233
234
@Throws(RefreshRootsException ::class )
234
- private fun findFile0 (path : String , type : SourceType ): VirtualFile ? {
235
+ private fun findFile0 (path : String , type : SourceType ): VirtualFile ? = application.runReadAction< VirtualFile ?> {
235
236
val roots = roots[type]
236
237
237
238
for (root in roots) {
238
239
val r = root ? : continue
239
240
if (! r.isValid) {
240
241
throw RefreshRootsException ()
241
242
}
242
- return r.findFileByRelativePath(path) ? : continue
243
+ return @runReadAction r.findFileByRelativePath(path) ? : continue
243
244
}
244
245
245
- return null
246
+ return @runReadAction null
246
247
}
247
248
248
249
companion object {
You can’t perform that action at this time.
0 commit comments