Skip to content

Commit 9c80d14

Browse files
committed
extend nil pointer checks for the response
1 parent db5832d commit 9c80d14

File tree

1 file changed

+6
-0
lines changed
  • internal/cmd/beta/logs/instance/create

1 file changed

+6
-0
lines changed

internal/cmd/beta/logs/instance/create/create.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
9292
if err != nil {
9393
return fmt.Errorf("create Logs instance: %w", err)
9494
}
95+
if resp == nil {
96+
return fmt.Errorf("create Logs instance: empty response from API")
97+
}
98+
if resp.Id == nil {
99+
return fmt.Errorf("create Logs instance: instance id missing in response")
100+
}
95101
instanceId := *resp.Id
96102

97103
// Wait for async operation, if async mode not enabled

0 commit comments

Comments
 (0)