Chromium Code Reviews| Index: chrome/browser/media_gallery/media_storage_util.cc |
| diff --git a/chrome/browser/media_gallery/media_storage_util.cc b/chrome/browser/media_gallery/media_storage_util.cc |
| index d41f13c508e3f5561c93e06c4a4c8962447cf971..ec5c013fdfdc3fb33a879981baefbcf4c19e218b 100644 |
| --- a/chrome/browser/media_gallery/media_storage_util.cc |
| +++ b/chrome/browser/media_gallery/media_storage_util.cc |
| @@ -102,7 +102,10 @@ std::string MediaStorageUtil::MakeDeviceId(Type type, |
| bool MediaStorageUtil::CrackDeviceId(const std::string& device_id, |
| Type* type, std::string* unique_id) { |
| size_t prefix_length = device_id.find_first_of(':'); |
| - std::string prefix = device_id.substr(0, prefix_length); |
| + std::string prefix; |
| + if (prefix_length != std::string::npos) { |
|
benwells
2012/08/28 08:50:51
Are there instances where there are no colons in t
thorogood
2012/08/28 23:48:11
I don't believe so. The device_id is only somethin
|
| + prefix = device_id.substr(0, prefix_length + 1); |
| + } |
| Type found_type; |
| if (prefix == kUsbMassStorageWithDCIMPrefix) { |