Chromium Code Reviews| Index: mojo/shell/desktop/mojo_main.cc |
| diff --git a/mojo/shell/desktop/mojo_main.cc b/mojo/shell/desktop/mojo_main.cc |
| index 02be823e8ef4475412f11d99d1cf8c7a6c6e1591..937dd61997c47c8d0aa670f01ab5ad6c54062dbd 100644 |
| --- a/mojo/shell/desktop/mojo_main.cc |
| +++ b/mojo/shell/desktop/mojo_main.cc |
| @@ -57,6 +57,9 @@ GURL GetAppURLAndSetArgs(const base::CommandLine::StringType& app_url_and_args, |
| if (argv.empty()) |
| return GURL::EmptyGURL(); |
| GURL app_url(argv[0]); |
| + if (!app_url.is_valid()) { |
| + LOG(ERROR) << "Error: invalid URL: " << argv[0]; |
|
Aaron Boodman
2014/11/20 22:16:02
Add a return here. We don't want to set any args f
azani
2014/11/20 22:18:00
Done.
|
| + } |
| if (argv.size() > 1) |
| context->application_manager()->SetArgsForURL(argv, app_url); |
| return app_url; |
| @@ -64,8 +67,12 @@ GURL GetAppURLAndSetArgs(const base::CommandLine::StringType& app_url_and_args, |
| void RunApps(mojo::shell::Context* context) { |
| const auto& command_line = *base::CommandLine::ForCurrentProcess(); |
| - for (const auto& arg : command_line.GetArgs()) |
| - context->Run(GetAppURLAndSetArgs(arg, context)); |
| + for (const auto& arg : command_line.GetArgs()) { |
| + GURL url = GetAppURLAndSetArgs(arg, context); |
| + if (!url.is_valid()) |
| + return; |
| + context->Run(url); |
| + } |
| } |
| void Usage() { |