Merge pull request #1640 from benphelps/feature/handle-invalid-service-fields
Handle invalid fields syntax in service labels
This commit is contained in:
commit
2e892ac906
1 changed files with 9 additions and 2 deletions
|
@ -291,8 +291,15 @@ export function cleanServiceGroups(groups) {
|
|||
enableQueue, // sonarr/radarr
|
||||
} = cleanedService.widget;
|
||||
|
||||
const fieldsList = typeof fields === 'string' ? JSON.parse(fields) : fields;
|
||||
|
||||
let fieldsList = fields;
|
||||
if (typeof fields === 'string') {
|
||||
try { JSON.parse(fields) }
|
||||
catch (e) {
|
||||
logger.error("Invalid fields list detected in config for service '%s'", service.name);
|
||||
fieldsList = null;
|
||||
}
|
||||
}
|
||||
|
||||
cleanedService.widget = {
|
||||
type,
|
||||
fields: fieldsList || null,
|
||||
|
|
Loading…
Add table
Reference in a new issue