mirror of
https://github.com/extism/extism.git
synced 2026-01-09 13:57:55 -05:00
Safe access to nilable error
There appears to be a situation in which this err can be nil
This commit is contained in:
@@ -44,7 +44,7 @@ class Plugin
|
||||
rc = C.extism_call(@plugin, name, input, data.bytesize)
|
||||
if rc != 0 then
|
||||
err = C.extism_error(@plugin)
|
||||
if err.empty? then
|
||||
if err&.empty? then
|
||||
raise Error.new "extism_call failed"
|
||||
else raise Error.new err
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user