informalsystems / themis-contract

A command line-based parameterized contracting tool
Apache License 2.0
46 stars 5 forks source link

Invoking `profile add` without arguments results in index error #78

Open shonfeder opened 4 years ago

shonfeder commented 4 years ago
$themis-contract profile add
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
main.profileAddCmd.func1(0xc0001642c0, 0xc05950, 0x0, 0x0)
    /home/sf/Sync/informal-systems/contracts/themis-contract/cmd/themis-contract/profile.go:89 +0x451
github.com/spf13/cobra.(*Command).execute(0xc0001642c0, 0xc05950, 0x0, 0x0, 0xc0001642c0, 0xc05950)
    /home/sf/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0xc00013c840, 0x0, 0x0, 0xc000159f48)
    /home/sf/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
    /home/sf/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
main.main()
    /home/sf/Sync/informal-systems/contracts/themis-contract/cmd/themis-contract/main.go:14 +0xc5
adizere commented 3 years ago

Confirm I encountered the same bug.