diff --git a/lib/Service/CategoryRepository.php b/lib/Service/CategoryRepository.php index 4328dc4..84ab7d3 100644 --- a/lib/Service/CategoryRepository.php +++ b/lib/Service/CategoryRepository.php @@ -5,6 +5,7 @@ namespace OCA\SideMenu\Service; use OC\App\AppStore\Fetcher\CategoryFetcher; use OCA\SideMenu\AppInfo\Application; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\Exceptions\AppConfigTypeConflictException; use OCP\IAppConfig; use OCP\ICache; use OCP\ICacheFactory; @@ -137,7 +138,12 @@ class CategoryRepository return $categories; } } else { - $stored = $this->appConfig->getValueArray(Application::APP_ID, self::CACHE_KEY, [], lazy: true); + try { + $stored = $this->appConfig->getValueArray(Application::APP_ID, self::CACHE_KEY, [], lazy: true); + } catch (AppConfigTypeConflictException) { + // Stored with another type, e.g. set by hand; refreshed below + $stored = []; + } if (isset($stored['expires'], $stored['categories']) && $stored['expires'] > $this->timeFactory->getTime()) { return $stored['categories'];