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
NOTRY=true
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2053743002
Cr-Commit-Position: refs/heads/master@{#399281}
(cherry picked from commit 16bc9a2)

Review-Url: https://codereview.chromium.org/2065023002
Cr-Commit-Position: refs/branch-heads/2743@{crosswalk-project#351}
Cr-Branched-From: 2b3ae3b-refs/heads/master@{#394939}
  • Loading branch information
btolsch authored and Commit bot committed Jun 14, 2016
1 parent 18119df commit 964f4be
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 964f4be

Please sign in to comment.