Skip to content
This repository was archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
Fixed crash if the push bare JID is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
COM8 committed May 14, 2022
1 parent af9089f commit 0f18c24
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Manager/Classes/Push/ClientPushManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ private async Task EnablePushAsync()
{
PushAccountModel push = CLIENT.dbAccount.push;

if (string.IsNullOrEmpty(push.bareJid) || string.IsNullOrEmpty(push.node))
{
Logger.Info($"Skipping push initialization for '{CLIENT.dbAccount.bareJid}' - server JID or node is empty.");
return;
}

MessageResponseHelperResult<IQMessage> result = await CLIENT.xmppClient.GENERAL_COMMAND_HELPER.enablePushNotificationsAsync(push.bareJid, push.node, push.secret);
if (result.STATE == MessageResponseHelperResultState.SUCCESS)
{
Expand Down

0 comments on commit 0f18c24

Please sign in to comment.