From 7e6d9d12185bcae68d0a18bb32da8fac65e8cadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Jos=C3=A9?= Date: Wed, 3 Apr 2024 13:55:53 +0200 Subject: [PATCH] fix: redis parser when value is undefined --- src/angular/factory/p3xr-redis-parser.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/angular/factory/p3xr-redis-parser.js b/src/angular/factory/p3xr-redis-parser.js index 1f6f4e3..780d456 100644 --- a/src/angular/factory/p3xr-redis-parser.js +++ b/src/angular/factory/p3xr-redis-parser.js @@ -36,9 +36,10 @@ p3xr.ng.factory('p3xrRedisParser', function ($rootScope) { currentSectionObj = {} } else if (line.length > 2) { const lineArray = line.split(':') - currentSectionObj[lineArray[0]] = lineArray[1].includes(',') ? selfMain.array({ - line: lineArray[1].trim() - }) : lineArray[1].trim() + const value = lineArray[1] ?? ""; + currentSectionObj[lineArray[0]] = value.includes(',') ? selfMain.array({ + line: value.trim() + }) : value.trim() } } if (section !== undefined) {