1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-23 04:22:05 +01:00

Add assert to IQ.initializeAsResultFor(IQ)

This method is not meant to be used to be invoked with the identity.
This commit is contained in:
Florian Schmaus 2019-07-04 15:48:07 +02:00
parent 870e6c674a
commit 1b5a264d52

View file

@ -261,6 +261,8 @@ public abstract class IQ extends Stanza {
} }
protected final void initializeAsResultFor(IQ request) { protected final void initializeAsResultFor(IQ request) {
assert this != request;
if (!(request.getType() == Type.get || request.getType() == Type.set)) { if (!(request.getType() == Type.get || request.getType() == Type.set)) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"IQ must be of type 'set' or 'get'. Original IQ: " + request.toXML()); "IQ must be of type 'set' or 'get'. Original IQ: " + request.toXML());