1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-09-21 07:29:33 +02:00

Protect against bad xmpp error types.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@5458 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Matt Tucker 2006-09-20 16:43:40 +00:00 committed by matt
parent 49a07980de
commit 48fac74878

View file

@ -337,8 +337,16 @@ public class PacketParserUtils {
} }
} }
} }
return new XMPPError(Integer.parseInt(errorCode), XMPPError.Type // Parse the error type.
.valueOf(type.toUpperCase()), condition, message, extensions); XMPPError.Type errorType = XMPPError.Type.CANCEL;
try {
errorType = XMPPError.Type.valueOf(type.toUpperCase());
}
catch (IllegalArgumentException iae) {
// Print stack trace. We shouldn't be getting an illegal error type.
iae.printStackTrace();
}
return new XMPPError(Integer.parseInt(errorCode), errorType, condition, message, extensions);
} }
/** /**