File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,9 @@ func (cli *Client) handlePresence(node *waBinary.Node) {
6262// You should call this at least once after connecting so that the server has your pushname. 
6363// Otherwise, other users will see "-" as the name. 
6464func  (cli  * Client ) SendPresence (state  types.Presence ) error  {
65- 	if  len (cli .Store .PushName ) ==  0  {
65+ 	if  cli  ==  nil  {
66+ 		return  ErrClientIsNil 
67+ 	} else  if  len (cli .Store .PushName ) ==  0  {
6668		return  ErrNoPushName 
6769	}
6870	if  state  ==  types .PresenceAvailable  {
@@ -88,6 +90,9 @@ func (cli *Client) SendPresence(state types.Presence) error {
8890// 
8991//	cli.SendPresence(types.PresenceAvailable) 
9092func  (cli  * Client ) SubscribePresence (jid  types.JID ) error  {
93+ 	if  cli  ==  nil  {
94+ 		return  ErrClientIsNil 
95+ 	}
9196	privacyToken , err  :=  cli .Store .PrivacyTokens .GetPrivacyToken (context .TODO (), jid )
9297	if  err  !=  nil  {
9398		return  fmt .Errorf ("failed to get privacy token: %w" , err )
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments