Skip to content

Commit

Permalink
views: Fix crash when setSizeConstrains is called early
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Oct 15, 2015
1 parent f52c4af commit 6aec8b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion atom/browser/native_window_views.cc
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,10 @@ gfx::Size NativeWindowViews::GetContentSize() {
void NativeWindowViews::SetContentSizeConstraints(
const extensions::SizeConstraints& size_constraints) {
NativeWindow::SetContentSizeConstraints(size_constraints);
window_->OnSizeConstraintsChanged();
// widget_delegate() is only available after Init() is called, we make use of
// this to determine whether native widget has initialized.
if (window_ && window_->widget_delegate())
window_->OnSizeConstraintsChanged();
#if defined(USE_X11)
if (resizable_)
old_size_constraints_ = size_constraints;
Expand Down

0 comments on commit 6aec8b0

Please sign in to comment.