Skip to content

Commit

Permalink
app logs: Protect against panic when no deployment is found. (#879)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsomething committed Oct 8, 2020
1 parent 9c5be03 commit a5b1cd2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion commands/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,13 @@ func RunAppsGetLogs(c *CmdConfig) error {
if err != nil {
return err
}
deploymentID = app.ActiveDeployment.ID
if app.ActiveDeployment != nil {
deploymentID = app.ActiveDeployment.ID
} else if app.InProgressDeployment != nil {
deploymentID = app.InProgressDeployment.ID
} else {
return fmt.Errorf("unable to retrieve logs; no deployment found for app %s", appID)
}
}

logTypeStr, err := c.Doit.GetString(c.NS, doctl.ArgAppLogType)
Expand Down

0 comments on commit a5b1cd2

Please sign in to comment.