diff --git a/atom/browser/api/atom_api_notification.cc b/atom/browser/api/atom_api_notification.cc index ef5b9ce129..7db7dbf38a 100644 --- a/atom/browser/api/atom_api_notification.cc +++ b/atom/browser/api/atom_api_notification.cc @@ -169,10 +169,10 @@ void Notification::NotificationDisplayed() { } void Notification::NotificationDestroyed() { - Emit("close"); } void Notification::NotificationClosed() { + Emit("close"); } // Showing notifications diff --git a/atom/browser/api/event_emitter.h b/atom/browser/api/event_emitter.h index ead3beddaa..f5a8025e86 100644 --- a/atom/browser/api/event_emitter.h +++ b/atom/browser/api/event_emitter.h @@ -79,8 +79,12 @@ class EventEmitter : public Wrappable { const Args&... args) { v8::Locker locker(isolate()); v8::HandleScope handle_scope(isolate()); + v8::Local wrapper = GetWrapper(); + if (wrapper.IsEmpty()) { + return false; + } v8::Local event = internal::CreateJSEvent( - isolate(), GetWrapper(), sender, message); + isolate(), wrapper, sender, message); return EmitWithEvent(name, event, args...); } diff --git a/atom/browser/api/trackable_object.h b/atom/browser/api/trackable_object.h index e632f52b84..6fcde898a6 100644 --- a/atom/browser/api/trackable_object.h +++ b/atom/browser/api/trackable_object.h @@ -62,7 +62,10 @@ class TrackableObject : public TrackableObjectBase, public: // Mark the JS object as destroyed. void MarkDestroyed() { - Wrappable::GetWrapper()->SetAlignedPointerInInternalField(0, nullptr); + v8::Local wrapper = Wrappable::GetWrapper(); + if (!wrapper.IsEmpty()) { + wrapper->SetAlignedPointerInInternalField(0, nullptr); + } } bool IsDestroyed() { diff --git a/docs/api/notification.md b/docs/api/notification.md index 402bbb69db..9c041a76ce 100644 --- a/docs/api/notification.md +++ b/docs/api/notification.md @@ -74,7 +74,7 @@ Returns: Emitted when the notification is closed by manual intervention from the user. -This event is not guarunteed to be emitted in all cases where the notification +This event is not guaranteed to be emitted in all cases where the notification is closed. #### Event: 'reply' _macOS_ diff --git a/vendor/native_mate b/vendor/native_mate index f047bb61bb..bf92fa88b7 160000 --- a/vendor/native_mate +++ b/vendor/native_mate @@ -1 +1 @@ -Subproject commit f047bb61bbd985079dd93e7ed322999550efed1d +Subproject commit bf92fa88b735b8c9ff951e6ef78a531bd10e8778