From 03539527b41164efe42d8ab0194633a7ae76c95a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 12 Aug 2020 23:37:10 +0200 Subject: [PATCH] Fix error handling in controller#getPageData We were accidentally resolving the promise with `undefined`, rather than rejecting it. This later caused "TypeError: Cannot read property 'linterrors' of undefined" in controller#checkCommentOnPage. Bug: T260294 Change-Id: I29418988023d86140cfa110c0c348059b293a716 --- modules/controller.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/controller.js b/modules/controller.js index aad467bf6..f567fb003 100644 --- a/modules/controller.js +++ b/modules/controller.js @@ -101,6 +101,8 @@ function getPageData( pageName, oldId ) { }, function () { // Clear on failure pageDataCache[ pageName ][ oldId ] = null; + // Let caller handle the error + return $.Deferred().rejectWith( this, arguments ); } ); return pageDataCache[ pageName ][ oldId ]; }