diff --git a/src/go/rpk/pkg/adminapi/admin.go b/src/go/rpk/pkg/adminapi/admin.go index c664dec64fdce..a29a2c653ecee 100644 --- a/src/go/rpk/pkg/adminapi/admin.go +++ b/src/go/rpk/pkg/adminapi/admin.go @@ -160,9 +160,11 @@ func licenseFeatureChecks(ctx context.Context, fs afero.Fs, cl *rpadmin.AdminAPI } if exists && y != nil { actProfile := y.Profile(p.Name) - actProfile.LicenseCheck = licenseCheck - if err := y.Write(fs); err != nil { - zap.L().Sugar().Warnf("unable to save licensed enterprise features check cache to profile: %v", err) + if actProfile != nil { + actProfile.LicenseCheck = licenseCheck + if err := y.Write(fs); err != nil { + zap.L().Sugar().Warnf("unable to save licensed enterprise features check cache to profile: %v", err) + } } } }