Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
fix: crash when selecting/closing file (fixes #1498) (#1507)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsvks19 authored Dec 1, 2023
1 parent 8ac221c commit 1f38006
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ interface ActionItem {
}

fun forId(id: String): Location {
return values().first { it.id == id }
return entries.first { it.id == id }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,8 @@ open class EditorHandlerActivity : ProjectHandlerActivity(), IEditorHandler {

override fun getEditorForFile(file: File): CodeEditorView? {
for (i in 0 until editorViewModel.getOpenedFileCount()) {
val editor = binding.editorContainer.getChildAt(i) as CodeEditorView
if (file == editor.file) {
return editor
}
val editor = binding.editorContainer.getChildAt(i) as? CodeEditorView
if (file == editor?.file) return editor
}
return null
}
Expand Down

0 comments on commit 1f38006

Please sign in to comment.