Don't panic when plugin's Ns variable has wrong type.

This commit is contained in:
Qi Xiao 2021-06-20 22:13:49 +01:00
parent 30a93948d7
commit 75fc7eb839

View File

@ -386,7 +386,10 @@ func useFromFile(fm *Frame, spec, path string, r diag.Ranger) (*Ns, error) {
if err != nil {
return nil, err
}
ns := sym.(**Ns)
ns, ok := sym.(**Ns)
if !ok {
return nil, noSuchModule{spec}
}
fm.Evaler.modules[path] = *ns
return *ns, nil
}