Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(794)

Unified Diff: components/mus/ws/event_dispatcher.cc

Issue 1819413002: Don't DCHECK in EventDispatcher::RemoveAccelerator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/event_dispatcher.cc
diff --git a/components/mus/ws/event_dispatcher.cc b/components/mus/ws/event_dispatcher.cc
index 57efcc1d9da32e677b6579c82426a99450b3f9fb..9b633b03831369eb76c65d8f72456d233c8a2a61 100644
--- a/components/mus/ws/event_dispatcher.cc
+++ b/components/mus/ws/event_dispatcher.cc
@@ -315,8 +315,9 @@ bool EventDispatcher::AddAccelerator(uint32_t id,
void EventDispatcher::RemoveAccelerator(uint32_t id) {
auto it = accelerators_.find(id);
- DCHECK(it != accelerators_.end());
- accelerators_.erase(it);
+ // Clients may pass bogus ids.
+ if (it != accelerators_.end())
+ accelerators_.erase(it);
}
void EventDispatcher::ProcessEvent(const ui::Event& event) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698