summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-09-09 00:18:43 -0400
committerTJ DeVries <devries.timothyj@gmail.com>2020-09-09 00:18:43 -0400
commitfe7dec63396c40a413db192f2374f74e0eed9d78 (patch)
tree1c3a5cbe53280878e94416902c42ac9a0142ba12 /lua
parentb0faec6dd9eeda463905177f5a3adb347c60b833 (diff)
fix: don't accidentally mess with state
Diffstat (limited to 'lua')
-rw-r--r--lua/telescope/previewers.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/lua/telescope/previewers.lua b/lua/telescope/previewers.lua
index 44c1f09..3f0713d 100644
--- a/lua/telescope/previewers.lua
+++ b/lua/telescope/previewers.lua
@@ -185,6 +185,10 @@ previewers.cat = defaulter(function(opts)
end,
teardown = function(self)
+ if not self.state then
+ return
+ end
+
if self.state.termopen_id then
pcall(vim.fn.chanclose, self.state.termopen_id)
end