diff options
Diffstat (limited to 'modules/textadept')
-rw-r--r-- | modules/textadept/editing.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index 238db220..3224a560 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -515,10 +515,10 @@ function M.filter_through(command) -- Use the whole buffer as input. buffer:target_whole_document() end - local p = spawn(command) + local p = assert(spawn(command)) p:write(buffer.target_text) p:close() - buffer:replace_target(p:read('*a'):iconv('UTF-8', _CHARSET)) + buffer:replace_target((p:read('*a') or ''):iconv('UTF-8', _CHARSET)) if s ~= e then buffer:set_sel(buffer.target_start, buffer.target_end) else |