akamai/cli-dns

Panic error when running "akamai dns list-zoneconfig"

javiergarza opened this issue · 0 comments

The "list-zoneconfig" breaks with a panic error when indicated without any optional parameters. For example this fails:

akamai dns list-zoneconfig
Retrieving Zone List ... [OK]
Assembling Zone List . panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x7f5a38]

goroutine 1 [running]:
main.renderZoneListTable(0xc00013e6e0, 0x2a, 0x2a, 0xc00013e2c0, 0xc0001086e0, 0x0)
	/go/src/github.com/akamai/cli-dns/command_list_zoneconfig.go:200 +0x828
main.cmdListZoneconfig(0xc00013e2c0, 0x0, 0x0)
	/go/src/github.com/akamai/cli-dns/command_list_zoneconfig.go:137 +0x1014
github.com/urfave/cli.HandleAction(0x865660, 0x915f48, 0xc00013e2c0, 0xc00013e2c0, 0x0)
	/go/src/github.com/akamai/cli-dns/vendor/github.com/urfave/cli/app.go:523 +0x11a
github.com/urfave/cli.Command.Run(0x8f7510, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/go/src/github.com/akamai/cli-dns/vendor/github.com/urfave/cli/command.go:174 +0x56e
github.com/urfave/cli.(*App).Run(0xc000122380, 0xc0000aa000, 0x2, 0x2, 0x0, 0x0)
	/go/src/github.com/akamai/cli-dns/vendor/github.com/urfave/cli/app.go:276 +0x7ae
main.main()
	/go/src/github.com/akamai/cli-dns/akamai-dns.go:37 +0xcf

While indicating parameters work:

akamai dns --section dns list-zoneconfig --search akamaideveloper.net --summary
Retrieving Zone List ... [OK]
Assembling Zone List ... [OK]


Zone List Summary

         ZONE            TYPE     ACTIVATION STATE   CONTRACT ID

  akamaideveloper.net   PRIMARY        ACTIVE         C-1FRYVV3

If the command requires a parameter then it should say so instead of throwing a panic error