fix(cmd_sub): Prevent crash with malformed JID in /sub command

Added null check for jidp in cmd_sub to handle jid_create returning NULL.

Crash occurred when processing malformed JID inputs like @example.com.

Ensures robust handling of invalid JIDs.

Fixes #22
This commit is contained in:
2025-09-01 22:55:46 +02:00
parent 51d2355d97
commit 2752019158
4 changed files with 20 additions and 0 deletions

View File

@@ -1,2 +1,3 @@
void cmd_sub_shows_message_when_not_connected(void** state);
void cmd_sub_shows_usage_when_no_arg(void** state);
void test_cmd_sub_malformed_jid(void** state);