chore: avoid crash while notification removal (#43060)
* avoid crash of operation on an invalid entry while erase set iterator. Co-authored-by: bill.shen <shenyb32768@gmail.com> * fix notification removal crash due to the nullptr presenter Co-authored-by: bill.shen <shenyb32768@gmail.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: bill.shen <shenyb32768@gmail.com>
This commit is contained in:
parent
00785e5444
commit
3a5ddd4c78
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