From 73995b2307a38bb59fc949cbff1f9f0c8008813a Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Wed, 28 Apr 2021 07:36:13 +0200 Subject: [PATCH] Minor improvement to app migration procedure --- pkg/provision/migrations_202103_apps.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/provision/migrations_202103_apps.go b/pkg/provision/migrations_202103_apps.go index 95251b09b..3d999255e 100644 --- a/pkg/provision/migrations_202103_apps.go +++ b/pkg/provision/migrations_202103_apps.go @@ -16,19 +16,19 @@ func migrateApplications(ctx context.Context, s store.Storer) error { } return set.Walk(func(app *types.Application) (err error) { - // Disable and unlist messaging app - // but only if it was not updated after 21.3 release date - if app.Unify.Url == "/messaging" && (app.UpdatedAt == nil || app.UpdatedAt.Before(rd)) { - if app.Unify == nil { - app.Unify = &types.ApplicationUnify{} - } + if app.Unify == nil { + return + } + if app.Unify.Url == "/messaging" && (app.UpdatedAt == nil || app.UpdatedAt.Before(rd)) { + // Disable and un-list messaging app + // but only if it was not updated after 21.3 release date app.Unify.Listed = false app.Enabled = false - err = store.UpdateApplication(ctx, s, app) + return store.UpdateApplication(ctx, s, app) } - return err + return nil }) }