mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-08 23:54:39 +00:00
refactor(chats): drop redundant !! on chat-message edit callback
The `if (canEditBuzz || canEditConcord)` guard already proves `onWantsToEditChatMessage` non-null — both booleans are local vals whose definitions begin with a null check, and K2 propagates that through them. The `!!` compiled to an assertion that could never fire, and produced an "Unnecessary non-null assertion" compiler warning. No behaviour change: the smart-cast invoke is what was already happening. If either guard is later loosened, this now fails at compile time instead of becoming a runtime NPE. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WopdqNoZ9tYoMNppJG17BL
This commit is contained in:
co-authored by
Claude Opus 5
parent
c64d4eacd2
commit
b07f8f203d
+1
-1
@@ -287,7 +287,7 @@ fun ChatMessageActionSheet(
|
||||
TileRow {
|
||||
val label = if (canEditBuzz) R.string.buzz_edit_message else R.string.edit_message
|
||||
ActionTile(MaterialSymbols.Edit, stringRes(label)) {
|
||||
onWantsToEditChatMessage!!(note)
|
||||
onWantsToEditChatMessage(note)
|
||||
onDismiss()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user