Commit 6d0039a0 authored by Hesen Zhang's avatar Hesen Zhang Committed by Commit Bot

Query tiles: Fix a crash due to sub-tile not found in response.

- If in the server side, the translation is not ready, even if the
top-level tile has a sub-level tile id, but the sub-level tile could be
not existing in the response.

- Remove the DCHECK, we just ignore this sub-tile in client side.

Change-Id: Ie1f8fab56dc100abc66ff13d55a197fe7704caf4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2202127Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Hesen Zhang <hesen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#768873}
parent 2dba32ef
...@@ -40,12 +40,13 @@ void ResponseToTile( ...@@ -40,12 +40,13 @@ void ResponseToTile(
} }
for (const auto& id : response.sub_tile_ids()) { for (const auto& id : response.sub_tile_ids()) {
DCHECK(sub_tiles_from_response.count(id)); if (sub_tiles_from_response.count(id)) {
auto sub_tile_from_response = sub_tiles_from_response.at(id); auto sub_tile_from_response = sub_tiles_from_response.at(id);
auto new_sub_tile = std::make_unique<Tile>(); auto new_sub_tile = std::make_unique<Tile>();
ResponseToTile(sub_tile_from_response, new_sub_tile.get(), ResponseToTile(sub_tile_from_response, new_sub_tile.get(),
sub_tiles_from_response); sub_tiles_from_response);
tile->sub_tiles.emplace_back(std::move(new_sub_tile)); tile->sub_tiles.emplace_back(std::move(new_sub_tile));
}
} }
} }
......
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