From 561c74615c5a764c90b311c3883876db4f5a54e5 Mon Sep 17 00:00:00 2001 From: Kevin Schiffer Date: Thu, 21 Dec 2023 16:44:58 +0900 Subject: [PATCH] console: Account for invalid responses in template conversion via https://the-things-industries.sentry.io/issues/4042370127 --- pkg/webui/console/containers/device-importer/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/webui/console/containers/device-importer/index.js b/pkg/webui/console/containers/device-importer/index.js index b6b24bad15..3aefea4b50 100644 --- a/pkg/webui/console/containers/device-importer/index.js +++ b/pkg/webui/console/containers/device-importer/index.js @@ -167,6 +167,14 @@ const DeviceImporter = () => { if (devices.length === 0) { throw conversionError + } else { + const invalidEntries = devices.filter(device => !('end_device' in device)) + if (devices.some(device => !('end_device' in device))) { + appendToLog('Invalid responses found:') + appendToLog(invalidEntries) + + throw conversionError + } } setConvertedDevices(devices)