Skip to content

Commit

Permalink
fix: slice index overflow for invalid input, just raised in our stric…
Browse files Browse the repository at this point in the history
…t testing case, it shouldn't be thrown in end user typing.
  • Loading branch information
hedzr committed Feb 2, 2022
1 parent 0cb2a15 commit ce512e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ptpkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ func (pkg *ptpkg) processExternalTool() (err error) {
}

func (pkg *ptpkg) xxSet(keyPath string, v interface{}) {
if pkg.a[0] == '~' {
if len(pkg.a) > 0 && pkg.a[0] == '~' {
pkg.store().SetNx(keyPath, v)
} else {
pkg.store().Set(keyPath, v)
Expand Down

0 comments on commit ce512e2

Please sign in to comment.