fix: don't throw on bad icons in BrowserWindow constructor (#27441)
* fix: do not throw if NativeImage conversion fails. Throwing is an unannounced semver/major breaking change, so revert that behavior but keep the rest of the #26546 refactor. * test: add invalid icon test * refactor: be explicit about when to throw or warn.
This commit is contained in:
parent
d69e0d0573
commit
5a8f40ae13
5 changed files with 49 additions and 12 deletions
|
@ -75,9 +75,13 @@ class NativeImage : public gin::Wrappable<NativeImage> {
|
|||
const gfx::Size& size);
|
||||
#endif
|
||||
|
||||
static bool TryConvertNativeImage(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> image,
|
||||
NativeImage** native_image);
|
||||
enum class OnConvertError { kThrow, kWarn };
|
||||
|
||||
static bool TryConvertNativeImage(
|
||||
v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> image,
|
||||
NativeImage** native_image,
|
||||
OnConvertError on_error = OnConvertError::kThrow);
|
||||
|
||||
// gin::Wrappable
|
||||
static gin::WrapperInfo kWrapperInfo;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue