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

Unified Diff: ui/events/devices/x11/device_data_manager_x11.cc

Issue 2856563002: Check entry exists in DeviceDataManagerX11::UpdateDeviceList(). (Closed)
Patch Set: Just fix bug. Created 3 years, 8 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: ui/events/devices/x11/device_data_manager_x11.cc
diff --git a/ui/events/devices/x11/device_data_manager_x11.cc b/ui/events/devices/x11/device_data_manager_x11.cc
index 7832f155da7b9b28e0a1e9376124520cd51b8737..6351aca2216e4a6b83b74f42f2842aca1e229039 100644
--- a/ui/events/devices/x11/device_data_manager_x11.cc
+++ b/ui/events/devices/x11/device_data_manager_x11.cc
@@ -680,6 +680,8 @@ bool DeviceDataManagerX11::GetDataRange(int deviceid,
CHECK_GE(deviceid, 0);
if (deviceid >= kMaxDeviceNum)
return false;
+ if (valuator_lookup_[deviceid].empty())
+ return false;
if (valuator_lookup_[deviceid][type] >= 0) {
*min = valuator_min_[deviceid][type];
*max = valuator_max_[deviceid][type];
« 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