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 a891f812da
commit 16b70619a2
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,
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;