chore: avoid crash while notification removal (#43040)
* avoid crash of operation on an invalid entry while erase set iterator. * fix notification removal crash due to the nullptr presenter --------- Co-authored-by: bill.shen <shenyb32768@gmail.com>
This commit is contained in:
parent
2fd04a78a1
commit
77ba40bc01
2 changed files with 8 additions and 1 deletions
|
@ -46,7 +46,9 @@ void Notification::NotificationFailed(const std::string& error) {
|
|||
void Notification::Remove() {}
|
||||
|
||||
void Notification::Destroy() {
|
||||
presenter()->RemoveNotification(this);
|
||||
if (presenter()) {
|
||||
presenter()->RemoveNotification(this);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue