Index: chrome/browser/chromeos/login/wallpaper_manager.cc |
diff --git a/chrome/browser/chromeos/login/wallpaper_manager.cc b/chrome/browser/chromeos/login/wallpaper_manager.cc |
index 55cd1998a4a5e980ca0a06d03702ac784270536a..25e5c494b14c717078bd46044e50895c1f295f8b 100644 |
--- a/chrome/browser/chromeos/login/wallpaper_manager.cc |
+++ b/chrome/browser/chromeos/login/wallpaper_manager.cc |
@@ -24,6 +24,7 @@ |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/string_util.h" |
#include "base/strings/stringprintf.h" |
+#include "base/sys_info.h" |
#include "base/threading/worker_pool.h" |
#include "base/time/time.h" |
#include "base/values.h" |
@@ -1333,6 +1334,24 @@ void WallpaperManager::LoadWallpaper(const std::string& user_id, |
MovableOnDestroyCallbackHolder on_finish) { |
base::FilePath wallpaper_dir; |
base::FilePath wallpaper_path; |
+ |
+ // Do a sanity check that file path information is not empty. |
+ if (info.type == User::ONLINE || info.type == User::DEFAULT) { |
+ if (info.file.empty()) { |
+ if (base::SysInfo::IsRunningOnChromeOS()) { |
+ NOTREACHED() << "User wallpaper info appears to be broken: " << user_id; |
+ } else { |
+ // Filename might be empty on debug configurations when stub users |
+ // were created directly in Local State (for testing). Ignore such |
+ // errors i.e. allowsuch type of debug configurations on the desktop. |
+ LOG(WARNING) << "User wallpaper info is empty: " << user_id; |
+ |
+ // |on_finish| callback will get called on destruction. |
+ return; |
+ } |
+ } |
+ } |
+ |
if (info.type == User::ONLINE) { |
std::string file_name = GURL(info.file).ExtractFileName(); |
WallpaperResolution resolution = GetAppropriateResolution(); |