mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-30 18:32:31 +02:00
Avoids parsing bad NIP-28 objects
This commit is contained in:
@@ -60,7 +60,7 @@ class ChannelCreateEvent(
|
||||
|
||||
val newInfo =
|
||||
try {
|
||||
if (isEncrypted()) {
|
||||
if (content.isEmpty() || !content.startsWith("{") || isEncrypted()) {
|
||||
ChannelDataNorm()
|
||||
} else {
|
||||
ChannelData.parse(content)?.normalize() ?: ChannelDataNorm()
|
||||
|
@@ -66,7 +66,7 @@ class ChannelMetadataEvent(
|
||||
|
||||
val newInfo =
|
||||
try {
|
||||
if (isEncrypted()) {
|
||||
if (content.isEmpty() || !content.startsWith("{") || isEncrypted()) {
|
||||
ChannelDataNorm()
|
||||
} else {
|
||||
ChannelData.parse(content)?.normalize() ?: ChannelDataNorm()
|
||||
|
Reference in New Issue
Block a user