mirror of
https://github.com/fiatjaf/nak.git
synced 2025-08-31 22:10:47 -04:00
fix panic (#12)
* c.Args().Len() - 1 might be negative value * fix getStdinLinesOrFirstArgument * fix getStdinLinesOrFirstArgument
This commit is contained in:
@@ -33,7 +33,7 @@ var decode = &cli.Command{
|
||||
},
|
||||
ArgsUsage: "<npub | nprofile | nip05 | nevent | naddr | nsec>",
|
||||
Action: func(c *cli.Context) error {
|
||||
for input := range getStdinLinesOrFirstArgument(c) {
|
||||
for input := range getStdinLinesOrFirstArgument(c.Args().First()) {
|
||||
if strings.HasPrefix(input, "nostr:") {
|
||||
input = input[6:]
|
||||
}
|
||||
|
Reference in New Issue
Block a user