fix crash when save event

This commit is contained in:
2026-06-12 10:43:42 +07:00
parent 8e7a1e6d7c
commit 4449242581

View File

@@ -379,9 +379,6 @@ class Nostr {
private suspend fun setCachedRumor(giftId: EventId, rumor: UnsignedEvent) {
try {
val currentUser =
signer.currentUser ?: throw IllegalStateException("User not signed in")
// Construct the room id
val roomId = rumor.roomId()
@@ -396,10 +393,10 @@ class Nostr {
// Set event kind
val kind = Kind.fromStd(KindStandard.APPLICATION_SPECIFIC_DATA);
// Construct event
val event = EventBuilder(kind, rumor.asJson())
.tags(tags)
.finalizeUnsigned(currentUser)
.signAsync(Keys.generate())
.finalizeAsync(signer)
client?.database()?.saveEvent(event)
} catch (e: Exception) {