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

Commit

Permalink
fix(editor/treesitter): occasional crash in TsBracketPairs
Browse files Browse the repository at this point in the history
This is caused by the incorrect order of conditions when checking whether the languageSpec.bracketsQuery can be accessed.
  • Loading branch information
itsaky committed Nov 18, 2023
1 parent cbe1381 commit cdc9ddb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class TsBracketPairs(private val tree: TSTree, private val languageSpec: TsLangu
}

override fun getPairedBracketAt(text: Content, index: Int): PairedBracket? {
if (languageSpec.bracketsQuery.patternCount <= 0
|| !languageSpec.bracketsQuery.canAccess()
if (!languageSpec.bracketsQuery.canAccess()
|| languageSpec.bracketsQuery.patternCount <= 0
|| !tree.canAccess()
) {
return null
Expand Down

0 comments on commit cdc9ddb

Please sign in to comment.