check that formattedBody exists before rendering a message as HTML
In case people send HTML messages without HTML, which they do for some reason.
This commit is contained in:
parent
cd60163caf
commit
285e6ad76a
1 changed files with 2 additions and 2 deletions
|
|
@ -73,11 +73,11 @@ class const MessageRenderer(
|
||||||
) => Column(
|
) => Column(
|
||||||
crossAxisAlignment: .start,
|
crossAxisAlignment: .start,
|
||||||
children: [
|
children: [
|
||||||
format == .html && !textOnly
|
format == .html && formattedBody != null && !textOnly
|
||||||
? Html(
|
? Html(
|
||||||
roomId: event.roomId,
|
roomId: event.roomId,
|
||||||
textStyle: textStyle,
|
textStyle: textStyle,
|
||||||
formattedBody!.replaceAllMapped(
|
formattedBody.replaceAllMapped(
|
||||||
RegExp(
|
RegExp(
|
||||||
r"(<a\b[^>]*>.*?<\/a>)|(\bhttps?:\/\/[^\s<]+)",
|
r"(<a\b[^>]*>.*?<\/a>)|(\bhttps?:\/\/[^\s<]+)",
|
||||||
caseSensitive: false,
|
caseSensitive: false,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue