Fix crash when prevContent is none
This commit is contained in:
committed by
Carl Schwan
parent
e23d06ef70
commit
6dab5c5936
@@ -498,13 +498,12 @@ QString NeoChatRoom::eventToString(const RoomEvent &evt, Qt::TextFormat format,
|
|||||||
// FIXME: Rewind to the name that was at the time of this event
|
// FIXME: Rewind to the name that was at the time of this event
|
||||||
auto subjectName = this->htmlSafeMemberName(e.userId());
|
auto subjectName = this->htmlSafeMemberName(e.userId());
|
||||||
if (e.membership() == MembershipType::Leave) {
|
if (e.membership() == MembershipType::Leave) {
|
||||||
auto displayName = e.prevContent()->displayName;
|
|
||||||
#ifdef QUOTIENT_07
|
#ifdef QUOTIENT_07
|
||||||
if (displayName) {
|
if (e.prevContent() && e.prevContent()->displayName) {
|
||||||
subjectName = sanitized(*displayName).toHtmlEscaped();
|
subjectName = sanitized(*e.prevContent()->displayName).toHtmlEscaped();
|
||||||
#else
|
#else
|
||||||
if (displayName.isEmpty()) {
|
if (e.prevContent() && e.prevContent()->displayName.isEmpty()) {
|
||||||
subjectName = sanitized(displayName).toHtmlEscaped();
|
subjectName = sanitized(e.prevContent()->displayName).toHtmlEscaped();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user