From e7e20190dface4117abe70dcfd96d19b0e4f5339 Mon Sep 17 00:00:00 2001 From: Wangda Tan Date: Thu, 29 Mar 2018 15:03:31 -0700 Subject: [PATCH] YARN-8086. ManagedParentQueue with no leaf queues cause JS error in new UI. (Suma Shivaprasad via wangda) Change-Id: I6d82af91adec02698afddde6883b1fe1924e6041 --- .../main/webapp/app/serializers/yarn-queue/capacity-queue.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/capacity-queue.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/capacity-queue.js index e838255ba1d..57714e3d462 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/capacity-queue.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/capacity-queue.js @@ -24,7 +24,7 @@ export default DS.JSONAPISerializer.extend({ normalizeSingleResponse(store, primaryModelClass, payload, id, requestType) { var children = []; - if (payload.queues) { + if (payload.queues && payload.queues.queue) { payload.queues.queue.forEach(function(queue) { children.push(queue.queueName); }); @@ -122,7 +122,7 @@ export default DS.JSONAPISerializer.extend({ data.push(result.queue); includedData = includedData.concat(result.includedData); - if (payload.queues) { + if (payload.queues && payload.queues.queue) { for (var i = 0; i < payload.queues.queue.length; i++) { var queue = payload.queues.queue[i]; queue.myParent = payload.queueName;