mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
Don't panic when plugin's Ns variable has wrong type.
This commit is contained in:
parent
30a93948d7
commit
75fc7eb839
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user