mirror of
https://github.com/wazero/wazero
synced 2026-06-21 14:12:37 +00:00
runtime: return nil interface not nil pointer on error (#2376)
Signed-off-by: Nuno Cruces <ncruces@users.noreply.github.com>
This commit is contained in:
+2
-2
@@ -325,7 +325,7 @@ func (r *runtime) InstantiateModule(
|
|||||||
|
|
||||||
var sysCtx *internalsys.Context
|
var sysCtx *internalsys.Context
|
||||||
if sysCtx, err = config.toSysContext(); err != nil {
|
if sysCtx, err = config.toSysContext(); err != nil {
|
||||||
return
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
name := config.name
|
name := config.name
|
||||||
@@ -340,7 +340,7 @@ func (r *runtime) InstantiateModule(
|
|||||||
if code.closeWithModule {
|
if code.closeWithModule {
|
||||||
_ = code.Close(ctx) // don't overwrite the error
|
_ = code.Close(ctx) // don't overwrite the error
|
||||||
}
|
}
|
||||||
return
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if closeNotifier, ok := ctx.Value(expctxkeys.CloseNotifierKey{}).(experimentalapi.CloseNotifier); ok {
|
if closeNotifier, ok := ctx.Value(expctxkeys.CloseNotifierKey{}).(experimentalapi.CloseNotifier); ok {
|
||||||
|
|||||||
Reference in New Issue
Block a user