Index: chrome/browser/extensions/api/app_window/app_window_api.cc |
diff --git a/chrome/browser/extensions/api/app_window/app_window_api.cc b/chrome/browser/extensions/api/app_window/app_window_api.cc |
index edb97d6308771f6036289c04e42427a8f3764a06..dddad886fceb3e7296178af6c40fd2902048632b 100644 |
--- a/chrome/browser/extensions/api/app_window/app_window_api.cc |
+++ b/chrome/browser/extensions/api/app_window/app_window_api.cc |
@@ -31,14 +31,17 @@ bool AppWindowCreateFunction::RunImpl() { |
// ShellWindow::Create so we can set the opener at create time rather than |
// with a hack in AppWindowCustomBindings::GetView(). |
ShellWindow::CreateParams create_params; |
- if (params->options.width.get()) |
- create_params.bounds.set_width(*params->options.width.get()); |
- if (params->options.height.get()) |
- create_params.bounds.set_height(*params->options.height.get()); |
- if (params->options.left.get()) |
- create_params.bounds.set_x(*params->options.left.get()); |
- if (params->options.top.get()) |
- create_params.bounds.set_y(*params->options.top.get()); |
+ app_window::CreateWindowOptions* options = params->options.get(); |
+ if (options) { |
+ if (options->width.get()) |
+ create_params.bounds.set_width(*options->width.get()); |
+ if (options->height.get()) |
+ create_params.bounds.set_height(*options->height.get()); |
+ if (options->left.get()) |
+ create_params.bounds.set_x(*options->left.get()); |
+ if (options->top.get()) |
+ create_params.bounds.set_y(*options->top.get()); |
+ } |
ShellWindow* shell_window = |
ShellWindow::Create(profile(), GetExtension(), url, create_params); |
shell_window->Show(); |