Commit 16089216 authored by David Maunder's avatar David Maunder Committed by Commit Bot

Don't acquire URL on uninitialized Tab in LocationBarModel

We now enforce that tab attributes cannot be acquired after
Tab#destroy() has been called. This part of the code contains
an invalid assumption that the tab is ininitialized when calling
getUrlString().

Bug: 1117396
Change-Id: I54cc4feb317d302db04538cf006ac82cfaa7e730
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2410921Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Commit-Queue: David Maunder <davidjm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807100}
parent 93b973c3
...@@ -131,7 +131,7 @@ public class LocationBarModel implements ToolbarDataProvider, ToolbarCommonPrope ...@@ -131,7 +131,7 @@ public class LocationBarModel implements ToolbarDataProvider, ToolbarCommonPrope
} }
// TODO(yusufo) : Consider using this for all calls from getTab() for accessing url. // TODO(yusufo) : Consider using this for all calls from getTab() for accessing url.
if (!hasTab()) return ""; if (!hasTab() || !getTab().isInitialized()) return "";
// Tab.getUrl() returns empty string if it does not have a URL. // Tab.getUrl() returns empty string if it does not have a URL.
return getTab().getUrlString().trim(); return getTab().getUrlString().trim();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment