1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-10-31 17:25:58 +01:00

Assert that processPacket is not called with null

This commit is contained in:
Florian Schmaus 2014-12-28 18:05:04 +01:00
parent d295939285
commit 5d5e3c05c5
2 changed files with 1 additions and 4 deletions

View file

@ -905,6 +905,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* @param packet the packet to process. * @param packet the packet to process.
*/ */
protected void processPacket(Packet packet) { protected void processPacket(Packet packet) {
assert(packet != null);
lastStanzaReceived = System.currentTimeMillis(); lastStanzaReceived = System.currentTimeMillis();
// Deliver the incoming packet to listeners. // Deliver the incoming packet to listeners.
executorService.submit(new ListenerNotification(packet)); executorService.submit(new ListenerNotification(packet));

View file

@ -225,10 +225,6 @@ public class PacketCollector {
* @param packet the packet to process. * @param packet the packet to process.
*/ */
protected void processPacket(Packet packet) { protected void processPacket(Packet packet) {
if (packet == null) {
return;
}
if (packetFilter == null || packetFilter.accept(packet)) { if (packetFilter == null || packetFilter.accept(packet)) {
while (!resultQueue.offer(packet)) { while (!resultQueue.offer(packet)) {
// Since we know the queue is full, this poll should never actually block. // Since we know the queue is full, this poll should never actually block.