diff --git a/shell/browser/api/electron_api_base_window.cc b/shell/browser/api/electron_api_base_window.cc index 76465a61536..e09b368b500 100644 --- a/shell/browser/api/electron_api_base_window.cc +++ b/shell/browser/api/electron_api_base_window.cc @@ -98,10 +98,14 @@ BaseWindow::BaseWindow(v8::Isolate* isolate, window_->AddObserver(this); #if defined(TOOLKIT_VIEWS) - // Sets the window icon. - gin::Handle icon; - if (options.Get(options::kIcon, &icon) && !icon.IsEmpty()) - SetIcon(icon); + { + v8::TryCatch try_catch(isolate); + gin::Handle icon; + if (options.Get(options::kIcon, &icon) && !icon.IsEmpty()) + SetIcon(icon); + if (try_catch.HasCaught()) + LOG(ERROR) << "Failed to convert NativeImage"; + } #endif }