| Index: chrome/browser/media_gallery/media_galleries_preferences.cc
|
| diff --git a/chrome/browser/media_gallery/media_galleries_preferences.cc b/chrome/browser/media_gallery/media_galleries_preferences.cc
|
| index 16a9974b89adcdd0029ae43ab0bc8317b5dd800e..a951bcef86d3cf88ef44c5fad626052e7f1be4ba 100644
|
| --- a/chrome/browser/media_gallery/media_galleries_preferences.cc
|
| +++ b/chrome/browser/media_gallery/media_galleries_preferences.cc
|
| @@ -137,9 +137,12 @@ MediaGalleriesPreferences::MediaGalleriesPreferences(Profile* profile)
|
| std::string device_id;
|
| string16 display_name;
|
| FilePath relative_path;
|
| - MediaStorageUtil::GetDeviceInfoFromPath(pictures_path, &device_id,
|
| - &display_name, &relative_path);
|
| - AddGallery(device_id, display_name, relative_path, false /*user added*/);
|
| + if (MediaStorageUtil::GetDeviceInfoFromPath(pictures_path, &device_id,
|
| + &display_name,
|
| + &relative_path)) {
|
| + AddGallery(device_id, display_name, relative_path,
|
| + false /*user added*/);
|
| + }
|
| }
|
| }
|
| InitFromPrefs();
|
| @@ -175,8 +178,17 @@ bool MediaGalleriesPreferences::LookUpGalleryByPath(
|
| std::string device_id;
|
| string16 device_name;
|
| FilePath relative_path;
|
| - MediaStorageUtil::GetDeviceInfoFromPath(path, &device_id, &device_name,
|
| - &relative_path);
|
| + if (!MediaStorageUtil::GetDeviceInfoFromPath(path, &device_id, &device_name,
|
| + &relative_path)) {
|
| + if (gallery_info) {
|
| + gallery_info->pref_id = kInvalidMediaGalleryPrefId;
|
| + gallery_info->display_name = string16();
|
| + gallery_info->device_id = std::string();
|
| + gallery_info->path = FilePath();
|
| + gallery_info->type = MediaGalleryPrefInfo::kBlackListed;
|
| + }
|
| + return false;
|
| + }
|
| relative_path = relative_path.NormalizePathSeparators();
|
| MediaGalleryPrefIdSet galleries_on_device =
|
| LookUpGalleriesByDeviceId(device_id);
|
|
|