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

Unified Diff: tools/gn/action_target_generator.cc

Issue 292123012: Add an error for empty script names in GN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« 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: tools/gn/action_target_generator.cc
diff --git a/tools/gn/action_target_generator.cc b/tools/gn/action_target_generator.cc
index c51910c61b03752a7774e7dfa21627565dd95b1d..12b621ea4f12108d4128e4b66427d9eb8ae57b43 100644
--- a/tools/gn/action_target_generator.cc
+++ b/tools/gn/action_target_generator.cc
@@ -94,8 +94,13 @@ void ActionTargetGenerator::FillScript() {
if (!value->VerifyTypeIs(Value::STRING, err_))
return;
- target_->action_values().set_script(
- scope_->GetSourceDir().ResolveRelativeFile(value->string_value()));
+ SourceFile script_file =
+ scope_->GetSourceDir().ResolveRelativeFile(value->string_value());
+ if (script_file.value().empty()) {
+ *err_ = Err(*value, "script name is empty");
+ return;
+ }
+ target_->action_values().set_script(script_file);
}
void ActionTargetGenerator::FillScriptArgs() {
« 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