Skip to content

Commit

Permalink
[Media Router WebUI] Prevent error when route becomes null
Browse files Browse the repository at this point in the history
Once the route-details element is stamped, getSinkForRoute_ is bound to
currentRoute_. This becomes null if the route is stopped which causes
getSinkForRoute_ to throw an innocuous but noisy error. This change adds
a check of the route before dereferencing it.

BUG=614144
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2053743002
Cr-Commit-Position: refs/heads/master@{#399281}
  • Loading branch information
btolsch authored and Commit bot committed Jun 10, 2016
1 parent fecb785 commit 16bc9a2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1178,11 +1178,11 @@ Polymer({

/**
* @param {?media_router.Route} route Route to get the sink for.
* @return {?media_router.Sink|undefined} Sink associated with |route| or
* @return {?media_router.Sink} Sink associated with |route| or
* undefined if we don't have data for the sink.
*/
getSinkForRoute_: function(route) {
return this.sinkMap_[route.sinkId];
return route ? this.sinkMap_[route.sinkId] : null;
},

/**
Expand Down

0 comments on commit 16bc9a2

Please sign in to comment.