aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/TaskProcessing/Manager.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php
index 8afc62a05d4..96cdc8c44f8 100644
--- a/lib/private/TaskProcessing/Manager.php
+++ b/lib/private/TaskProcessing/Manager.php
@@ -568,11 +568,23 @@ class Manager implements IManager {
* @return array
*/
private function _getTaskTypeSettings(): array {
- $json = $this->config->getAppValue('core', 'ai.taskprocessing_type_preferences', '');
- if ($json === '') {
- return [];
+ try {
+ $json = $this->config->getAppValue('core', 'ai.taskprocessing_type_preferences', '');
+ if ($json === '') {
+ return [];
+ }
+ return json_decode($json, true, flags: JSON_THROW_ON_ERROR);
+ } catch (\JsonException $e) {
+ $this->logger->error('Failed to get settings. JSON Error in ai.taskprocessing_type_preferences', ['exception' => $e]);
+ $taskTypeSettings = [];
+ $taskTypes = $this->_getTaskTypes();
+ foreach ($taskTypes as $taskType) {
+ $taskTypeSettings[$taskType->getId()] = false;
+ };
+
+ return $taskTypeSettings;
}
- return json_decode($json, true, flags: JSON_THROW_ON_ERROR);
+
}
/**