1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-06-17 08:54:49 +02:00

Use IQ.isRequestIQ() in IQ

This commit is contained in:
Florian Schmaus 2019-04-08 23:05:23 +02:00
parent d1f2631771
commit 3075430713

View file

@ -297,7 +297,7 @@ public abstract class IQ extends Stanza {
* @return a new {@link Type#error IQ.Type.error} IQ based on the originating IQ. * @return a new {@link Type#error IQ.Type.error} IQ based on the originating IQ.
*/ */
public static ErrorIQ createErrorResponse(final IQ request, final StanzaError.Builder error) { public static ErrorIQ createErrorResponse(final IQ request, final StanzaError.Builder error) {
if (!(request.getType() == Type.get || request.getType() == Type.set)) { if (!request.isRequestIQ()) {
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());
} }