Skip to content

Commit c9f0990

Browse files
Fixed crash when sending invalid chat command
1 parent 6a59193 commit c9f0990

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
88

99
### 🐞 Fixed
1010
- Memory cache trimming on chat dismiss
11+
- Crash when sending an invalid command
1112

1213
# [4.16.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.16.0)
1314
_June 10, 2022_

Sources/StreamChatSwiftUI/ChatChannel/Composer/MessageComposerViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ open class MessageComposerViewModel: ObservableObject {
177177
checkChannelCooldown()
178178
}
179179

180-
if let composerCommand = composerCommand {
180+
if let composerCommand = composerCommand, composerCommand.id != "instantCommands" {
181181
commandsHandler.executeOnMessageSent(
182182
composerCommand: composerCommand
183183
) { [weak self] _ in

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageContainerView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public struct MessageContainerView<Factory: ViewFactory>: View {
6161

6262
public var body: some View {
6363
HStack(alignment: .bottom) {
64-
if message.type == .system {
64+
if message.type == .system || message.type == .error {
6565
factory.makeSystemMessageView(message: message)
6666
} else {
6767
if message.isSentByCurrentUser {

0 commit comments

Comments
 (0)