dangogh closed pull request #2134: TP - fixes possible null pointer exception
URL: https://github.com/apache/incubator-trafficcontrol/pull/2134
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_portal/app/src/app.js b/traffic_portal/app/src/app.js
index c7c1e6dbc..f0c4385b5 100644
--- a/traffic_portal/app/src/app.js
+++ b/traffic_portal/app/src/app.js
@@ -419,7 +419,7 @@ trafficPortal.factory('authInterceptor', function 
($rootScope, $q, $window, $loc
             } else if (rejection.status.toString().match(/^5\d[01356789]$/)) {
                 // matches 5xx EXCEPT for 502's and 504's which indicate a 
timeout and will be handled by each service call accordingly
                 $timeout(function () {
-                    if (alerts.length > 0) {
+                    if (alerts && alerts.length > 0) {
                             messageModel.setMessages(alerts, false);
                     } else {
                             messageModel.setMessages([ { level: 'error', text: 
rejection.status.toString() + ': ' + rejection.statusText } ], false);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to