Avoids parsing bad NIP-28 objects
This commit is contained in:
+1
-1
@@ -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()
|
||||||
|
|||||||
+1
-1
@@ -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