Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix empty pwd path read from gfile.Pwd() which could cause internal error logging for gview.New #3302

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions os/gview/gview.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading