Tolerate a null mesh myPeerID when building mention candidates

CommandProcessorTest mocks MeshService without stubbing myPeerID.
Pass orEmpty() so the helper does not NPE on that path.
This commit is contained in:
Taksh 2026-09-04 22:27:04 +05:30
parent 67dd9dcafc
commit 77646fbae9

View File

@ -564,7 +564,7 @@ class CommandProcessor(
null -> {
meshMentionCandidates(
peerNicknames = meshService.getPeerNicknames(),
myPeerID = meshService.myPeerID,
myPeerID = meshService.myPeerID.orEmpty(),
isPeerBlocked = privateChatManager::isPeerBlocked
)
}
@ -601,7 +601,7 @@ class CommandProcessor(
} else {
meshMentionCandidates(
peerNicknames = meshService.getPeerNicknames(),
myPeerID = meshService.myPeerID,
myPeerID = meshService.myPeerID.orEmpty(),
isPeerBlocked = privateChatManager::isPeerBlocked
)
}