Skip to content

Commit

Permalink
fix(sketch): add project disposal check in SketchInputListener
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Feb 11, 2025
1 parent ec7a607 commit 1abd39f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.invokeLater
import com.intellij.openapi.application.runReadAction
import com.intellij.openapi.project.Project
import kotlinx.coroutines.cancel
import kotlinx.coroutines.flow.cancellable
import kotlinx.coroutines.launch

Expand Down Expand Up @@ -67,6 +68,11 @@ class SketchInputListener(
suggestion.append(char)

invokeLater {
if (project.isDisposed) {
cancel()
return@invokeLater
}

toolWindow.onUpdate(suggestion.toString())
}
}
Expand Down

0 comments on commit 1abd39f

Please sign in to comment.