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

Unified Diff: tools/gn/function_read_file.cc

Issue 1155713006: GN: Make file/dir resolving return errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
Index: tools/gn/function_read_file.cc
diff --git a/tools/gn/function_read_file.cc b/tools/gn/function_read_file.cc
index 5a7662a672032596dc72b63baa9ea4bf67e9d37f..11585d8961531d8046a4531cc8cab1580a2ea12e 100644
--- a/tools/gn/function_read_file.cc
+++ b/tools/gn/function_read_file.cc
@@ -53,8 +53,10 @@ Value RunReadFile(Scope* scope,
// Compute the file name.
const SourceDir& cur_dir = scope->GetSourceDir();
- SourceFile source_file = cur_dir.ResolveRelativeFile(args[0].string_value(),
+ SourceFile source_file = cur_dir.ResolveRelativeFile(args[0], err,
scope->settings()->build_settings()->root_path_utf8());
+ if (err->has_error())
+ return Value();
base::FilePath file_path =
scope->settings()->build_settings()->GetFullPath(source_file);

Powered by Google App Engine
This is Rietveld 408576698