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

Unified Diff: media/midi/midi_manager_win.cc

Issue 1061893002: Web MIDI: use GetVendorName() result only if it is available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: name ? name : "" Created 5 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: media/midi/midi_manager_win.cc
diff --git a/media/midi/midi_manager_win.cc b/media/midi/midi_manager_win.cc
index 926fe291483348d45310b2b285b90c9c2b8198ab..1d140c3d7a40a2b42884580a80ec64e04c5b77c4 100644
--- a/media/midi/midi_manager_win.cc
+++ b/media/midi/midi_manager_win.cc
@@ -291,8 +291,10 @@ struct MidiDeviceInfo final {
};
std::string GetManufacturerName(const MidiDeviceInfo& info) {
- if (info.is_usb_device)
- return device::UsbIds::GetVendorName(info.usb_vendor_id);
+ if (info.is_usb_device) {
+ const char* name = device::UsbIds::GetVendorName(info.usb_vendor_id);
+ return std::string(name ? name : "");
+ }
switch (info.manufacturer_id) {
case MM_MICROSOFT:
« 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