1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 18:48:00 +01:00

Makes xmpperror descriptive text optional as said in the rfc.

This commit is contained in:
damencho 2017-10-27 13:14:50 -05:00
parent 0729392ab8
commit a0b0b5a63b

View file

@ -271,9 +271,13 @@ public class XMPPError extends AbstractError {
}
public static XMPPError.Builder from(Condition condition, String descriptiveText) {
Map<String, String> descriptiveTexts = new HashMap<String, String>();
descriptiveTexts.put("en", descriptiveText);
return getBuilder().setCondition(condition).setDescriptiveTexts(descriptiveTexts);
XMPPError.Builder builder = getBuilder().setCondition(condition);
if (descriptiveText != null) {
Map<String, String> descriptiveTexts = new HashMap<>();
descriptiveTexts.put("en", descriptiveText);
builder.setDescriptiveTexts(descriptiveTexts);
}
return builder;
}
public static Builder getBuilder() {