Skip to content

Commit 65c0e44

Browse files
committed
Don't crash when trying to build stubs for files that have been deleted
Fixes EA-97751
1 parent 690eaa9 commit 65c0e44

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/classFile/ClassFileDecompilerUtil.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ fun isKotlinWithCompatibleAbiVersion(file: VirtualFile): Boolean {
5050
* which should NOT be decompiled (and, as a result, shown under the library in the Project view, be searchable via Find class, etc.)
5151
*/
5252
fun isKotlinInternalCompiledFile(file: VirtualFile, fileContent: ByteArray? = null): Boolean {
53+
// Don't crash on invalid files (EA-97751)
54+
if (!file.isValid || fileContent?.size == 0) {
55+
return false
56+
}
57+
5358
if (!IDEKotlinBinaryClassCache.isKotlinJvmCompiledFile(file, fileContent)) {
5459
return false
5560
}

0 commit comments

Comments
 (0)