1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-21 22:02:06 +01: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.
*/
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(
"IQ must be of type 'set' or 'get'. Original IQ: " + request.toXML());
}