jamesnetherton / homehub-cli

CLI for the BT Home Hub router
MIT License
37 stars 5 forks source link

EnableDebug command throws nil pointer exception #27

Closed jamesnetherton closed 5 years ago

jamesnetherton commented 5 years ago

Happens if attempting to enable debugging without being logged in:

testing@homehub: EnableDebug true
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x78 pc=0x660451]

goroutine 1 [running]:
github.com/jamesnetherton/homehub-cli/cmd.NewEnableDebugCommand.func1(0xc0001243c0)
    /home/james/workspace/golang/src/github.com/jamesnetherton/homehub-cli/cmd/enable_debug.go:24 +0x121
github.com/jamesnetherton/homehub-cli/cmd.(*GenericCommand).Execute(0xc0001060e0, 0xc0001243c0)
    /home/james/workspace/golang/src/github.com/jamesnetherton/homehub-cli/cmd/generic_command.go:74 +0x34
github.com/jamesnetherton/homehub-cli/cmd.(*GenericCommand).ExecuteLifecylce(0xc0001060e0, 0xc00016e0c0, 0x1, 0x2)
    /home/james/workspace/golang/src/github.com/jamesnetherton/homehub-cli/cmd/generic_command.go:48 +0xfd
github.com/jamesnetherton/homehub-cli/cli.(*CLI).Run(0xc00000c360)
    /home/james/workspace/golang/src/github.com/jamesnetherton/homehub-cli/cli/cli.go:55 +0x26e
main.main()
    /home/james/workspace/golang/src/github.com/jamesnetherton/homehub-cli/homehub-cli.go:29 +0x2a1