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

Unified Diff: chrome/browser/extensions/path_util.cc

Issue 439873002: Check for empty paths in path_util (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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: chrome/browser/extensions/path_util.cc
diff --git a/chrome/browser/extensions/path_util.cc b/chrome/browser/extensions/path_util.cc
index 429f9e4438759217bb484e8b0e09260e73dc021f..37ccd745fab4b0296640883338e10f5b24f95ebe 100644
--- a/chrome/browser/extensions/path_util.cc
+++ b/chrome/browser/extensions/path_util.cc
@@ -42,6 +42,8 @@ std::string GetDisplayBaseName(const base::FilePath& path) {
} // namespace
base::FilePath PrettifyPath(const base::FilePath& source_path) {
not at google - send to devlin 2014/08/04 23:39:07 declare this function then do the empty-path check
+ if (source_path.empty())
+ return base::FilePath();
base::FilePath home_path;
PathService::Get(base::DIR_HOME, &home_path);
DCHECK(source_path.IsAbsolute());
@@ -71,6 +73,8 @@ base::FilePath PrettifyPath(const base::FilePath& source_path) {
}
#else // defined(OS_MACOSX)
base::FilePath PrettifyPath(const base::FilePath& source_path) {
+ if (source_path.empty())
+ return base::FilePath();
base::FilePath home_path;
base::FilePath display_path = base::FilePath::FromUTF8Unsafe("~");
if (PathService::Get(base::DIR_HOME, &home_path) &&
« 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