Handle 404s smoothly during create on codespaces pre-flight

This commit is contained in:
Jake Shorty 2022-06-17 21:09:38 +00:00 committed by GitHub
parent 09f926c475
commit b3d2cc6e37

View file

@ -133,7 +133,7 @@ func (a *App) Create(ctx context.Context, opts createOptions) error {
billableOwner, err := a.apiClient.GetCodespacePreFlight(ctx, userInputs.Repository)
a.StopProgressIndicator()
if billableOwner.Type == "Organization" {
if billableOwner != nil && billableOwner.Type == "Organization" {
cs := a.io.ColorScheme()
fmt.Fprintln(a.io.Out, cs.Blue("✓ Codespaces usage for this repository is paid for by "+billableOwner.Login))
} else if err != nil {