fix: don't accidentally mess with state

This commit is contained in:
TJ DeVries
2020-09-09 00:18:43 -04:00
parent b0faec6dd9
commit fe7dec6339

View File

@@ -185,6 +185,10 @@ previewers.cat = defaulter(function(opts)
end, end,
teardown = function(self) teardown = function(self)
if not self.state then
return
end
if self.state.termopen_id then if self.state.termopen_id then
pcall(vim.fn.chanclose, self.state.termopen_id) pcall(vim.fn.chanclose, self.state.termopen_id)
end end