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