mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
Do not call XmlPullParser.getName() when the event is unknown
XmlPullParser.getName() only returns a result if the current parser event is START_ELEMENT or END_ELEMENT. If this is not the case, then the method may throw (if StAX is used).
This commit is contained in:
parent
899813a668
commit
31e4e1faf2
24 changed files with 80 additions and 109 deletions
|
@ -41,8 +41,8 @@ public class PubkeyElementProvider extends ExtensionElementProvider<PubkeyElemen
|
|||
Date date = ParserUtils.getDateFromOptionalXep82String(dateString);
|
||||
while (true) {
|
||||
XmlPullParser.Event tag = parser.next();
|
||||
String name = parser.getName();
|
||||
if (tag == XmlPullParser.Event.START_ELEMENT) {
|
||||
String name = parser.getName();
|
||||
switch (name) {
|
||||
case PubkeyElement.PubkeyDataElement.ELEMENT:
|
||||
String base64EncodedOpenPgpPubKey = parser.nextText();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue