mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: use try/catch for base class converter error (#24450)
* fix: use try/catch for base class converter error * Place try/catch in a block Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -98,10 +98,14 @@ TopLevelWindow::TopLevelWindow(v8::Isolate* isolate,
|
||||
window_->AddObserver(this);
|
||||
|
||||
#if defined(TOOLKIT_VIEWS)
|
||||
// Sets the window icon.
|
||||
gin::Handle<NativeImage> icon;
|
||||
if (options.Get(options::kIcon, &icon) && !icon.IsEmpty())
|
||||
SetIcon(icon);
|
||||
{
|
||||
v8::TryCatch try_catch(isolate);
|
||||
gin::Handle<NativeImage> icon;
|
||||
if (options.Get(options::kIcon, &icon) && !icon.IsEmpty())
|
||||
SetIcon(icon);
|
||||
if (try_catch.HasCaught())
|
||||
LOG(ERROR) << "Failed to convert NativeImage";
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user