From 49e653dbaf0f9884d5dbf25f27f1a82d537598da Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Wed, 25 May 2022 04:05:02 -0400 Subject: [PATCH] Prevent exception when panel has multiple queries (#49368) (#49562) This fixes the issues that when a panel has multiple queries this throws an exception if source is not part of the current frame Co-authored-by: Ryan McKinley (cherry picked from commit eab806620c84878047eabb455a342da2f9a5a944) Co-authored-by: Ward Bekker --- .../app/features/transformers/extractFields/extractFields.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/app/features/transformers/extractFields/extractFields.ts b/public/app/features/transformers/extractFields/extractFields.ts index 81628b595ed..ede77024b40 100644 --- a/public/app/features/transformers/extractFields/extractFields.ts +++ b/public/app/features/transformers/extractFields/extractFields.ts @@ -41,7 +41,8 @@ function addExtractedFields(frame: DataFrame, options: ExtractFieldsOptions): Da } const source = findField(frame, options.source); if (!source) { - throw new Error('json field not found'); + // this case can happen when there are multiple queries + return frame; } const ext = fieldExtractors.getIfExists(options.format ?? FieldExtractorID.Auto);