Add the index checking for ash::ShelfModel items.
AppServiceAppWindowCrostiniTracker::OnAppLaunchRequested might be called when the window is not visible yet, so there is no shelf item yet in ash::ShelfModel items. model->ItemIndexByAppID(app_id) might return -1. So adding a checking for -1 (index < 0) to avoid system crash. BUG=1072870 Change-Id: I26aa2c2ba4fa7cf73af140792be94632a6953b06 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2157438 Commit-Queue: Nancy Wang <nancylingwang@chromium.org> Reviewed-by:Xiyuan Xia <xiyuan@chromium.org> Cr-Commit-Position: refs/heads/master@{#761025}
Showing
Please register or sign in to comment