From 4736eda160ff702cfaf99ebd066388027ab6b4e7 Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Fri, 5 Aug 2022 19:31:41 +0100 Subject: [PATCH] Fix unarchiving of the widget manager config. (#6541) --- Riot/Managers/Widgets/WidgetManager.m | 2 ++ changelog.d/6539.bugfix | 1 + 2 files changed, 3 insertions(+) create mode 100644 changelog.d/6539.bugfix diff --git a/Riot/Managers/Widgets/WidgetManager.m b/Riot/Managers/Widgets/WidgetManager.m index 81413d812..3595eb4df 100644 --- a/Riot/Managers/Widgets/WidgetManager.m +++ b/Riot/Managers/Widgets/WidgetManager.m @@ -779,6 +779,8 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain"; NSData *configsData = [userDefaults objectForKey:@"integrationManagerConfigs"]; if (configsData) { + // We need to map the config class name since the bundle name was updated otherwise unarchiving crashes. + [NSKeyedUnarchiver setClass:WidgetManagerConfig.class forClassName:@"Riot.WidgetManagerConfig"]; configs = [NSMutableDictionary dictionaryWithDictionary:[NSKeyedUnarchiver unarchiveObjectWithData:configsData]]; } diff --git a/changelog.d/6539.bugfix b/changelog.d/6539.bugfix new file mode 100644 index 000000000..392f528b1 --- /dev/null +++ b/changelog.d/6539.bugfix @@ -0,0 +1 @@ +Widgets: Fix a crash when loading the widget manager.