YARN-8086. ManagedParentQueue with no leaf queues cause JS error in new UI. (Suma Shivaprasad via wangda)

Change-Id: I6d82af91adec02698afddde6883b1fe1924e6041
(cherry picked from commit e7e20190df)
This commit is contained in:
Wangda Tan 2018-03-29 15:03:31 -07:00
parent b038e21440
commit b64bf56131
1 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ export default DS.JSONAPISerializer.extend({
normalizeSingleResponse(store, primaryModelClass, payload, id, normalizeSingleResponse(store, primaryModelClass, payload, id,
requestType) { requestType) {
var children = []; var children = [];
if (payload.queues) { if (payload.queues && payload.queues.queue) {
payload.queues.queue.forEach(function(queue) { payload.queues.queue.forEach(function(queue) {
children.push(queue.queueName); children.push(queue.queueName);
}); });
@ -122,7 +122,7 @@ export default DS.JSONAPISerializer.extend({
data.push(result.queue); data.push(result.queue);
includedData = includedData.concat(result.includedData); includedData = includedData.concat(result.includedData);
if (payload.queues) { if (payload.queues && payload.queues.queue) {
for (var i = 0; i < payload.queues.queue.length; i++) { for (var i = 0; i < payload.queues.queue.length; i++) {
var queue = payload.queues.queue[i]; var queue = payload.queues.queue[i];
queue.myParent = payload.queueName; queue.myParent = payload.queueName;