diff --git a/os/gview/gview.go b/os/gview/gview.go index c9de5947de4..3b60e8a1174 100644 --- a/os/gview/gview.go +++ b/os/gview/gview.go @@ -91,8 +91,10 @@ func New(path ...string) *View { } } else { // Dir path of working dir. - if err := view.SetPath(gfile.Pwd()); err != nil { - intlog.Errorf(context.TODO(), `%+v`, err) + if pwdPath := gfile.Pwd(); pwdPath != "" { + if err := view.SetPath(pwdPath); err != nil { + intlog.Errorf(context.TODO(), `%+v`, err) + } } // Dir path of binary. if selfPath := gfile.SelfDir(); selfPath != "" && gfile.Exists(selfPath) {