moved null check for to and from in message parser
This commit is contained in:
		
							parent
							
								
									c20a088ea8
								
							
						
					
					
						commit
						a2525346f4
					
				|  | @ -239,6 +239,12 @@ public class MessageParser extends AbstractParser implements | ||||||
| 		final Jid to = packet.getTo(); | 		final Jid to = packet.getTo(); | ||||||
| 		final Jid from = packet.getFrom(); | 		final Jid from = packet.getFrom(); | ||||||
| 		final String remoteMsgId = packet.getId(); | 		final String remoteMsgId = packet.getId(); | ||||||
|  | 
 | ||||||
|  | 		if (from == null || to == null) { | ||||||
|  | 			Log.d(Config.LOGTAG,"no to or from in: "+packet.toString()); | ||||||
|  | 			return; | ||||||
|  | 		} | ||||||
|  | 		 | ||||||
| 		boolean isTypeGroupChat = packet.getType() == MessagePacket.TYPE_GROUPCHAT; | 		boolean isTypeGroupChat = packet.getType() == MessagePacket.TYPE_GROUPCHAT; | ||||||
| 		boolean isProperlyAddressed = !to.isBareJid() || account.countPresences() == 1; | 		boolean isProperlyAddressed = !to.isBareJid() || account.countPresences() == 1; | ||||||
| 		boolean isMucStatusMessage = from.isBareJid() && mucUserElement != null && mucUserElement.hasChild("status"); | 		boolean isMucStatusMessage = from.isBareJid() && mucUserElement != null && mucUserElement.hasChild("status"); | ||||||
|  | @ -250,11 +256,6 @@ public class MessageParser extends AbstractParser implements | ||||||
| 			counterpart = from; | 			counterpart = from; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		if (from == null || to == null) { |  | ||||||
| 			Log.d(Config.LOGTAG,"no to or from in: "+packet.toString()); |  | ||||||
| 			return; |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 		Invite invite = extractInvite(packet); | 		Invite invite = extractInvite(packet); | ||||||
| 		if (invite != null && invite.execute(account)) { | 		if (invite != null && invite.execute(account)) { | ||||||
| 			return; | 			return; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Daniel Gultsch
						Daniel Gultsch