Skip to content

Panic on empty DNS record name #2523

@Codelax

Description

@Codelax

Reported on scaleway-sdk-go

When DNS record name is empty scw utility panics

scw dns record delete valid.dns.zone.name name="" type=CNAME --output json

produces

---------------------------------------------------------------------------------------
An error occurred, we are sorry, please consider opening a ticket on github using: 'scw feedback bug'
Give us as many details as possible so we can reproduce the error and fix it.
---------------------------------------------------------------------------------------
stacktrace from panic: 
goroutine 1 [running]:
runtime/debug.Stack()
        /opt/hostedtoolcache/go/1.17.13/x64/src/runtime/debug/stack.go:24 +0x65
main.cleanup(0xc000228fc0)
        /home/runner/work/scaleway-cli/scaleway-cli/cmd/scw/main.go:38 +0x85
panic({0xa10380, 0xfd1660})
        /opt/hostedtoolcache/go/1.17.13/x64/src/runtime/panic.go:1038 +0x215
github.com/scaleway/scaleway-cli/v2/internal/core.(*Printer).printJSON(0xc00023b8c0, {0x0, 0x0})
        /home/runner/work/scaleway-cli/scaleway-cli/internal/core/printer.go:235 +0x1e1
github.com/scaleway/scaleway-cli/v2/internal/core.(*Printer).Print(0xc00023b8c0, {0x0, 0x0}, 0xbcb898)
        /home/runner/work/scaleway-cli/scaleway-cli/internal/core/printer.go:150 +0x8f
github.com/scaleway/scaleway-cli/v2/internal/core.Bootstrap(0xc00048bed0)
        /home/runner/work/scaleway-cli/scaleway-cli/internal/core/bootstrap.go:222 +0xfcb
main.main()
        /home/runner/work/scaleway-cli/scaleway-cli/cmd/scw/main.go:59 +0x291

runtime error: invalid memory address or nil pointer dereference

Metadata

Metadata

Assignees

Labels

bugdomainDomains issues, bugs and feature requests

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions