Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-08 17:20:24 +01:00
Fix InformativeException NPE
Dieser Commit ist enthalten in:
Ursprung
3aa84b5a5a
Commit
ad7f782a1a
@ -43,25 +43,21 @@ public class InformativeException extends Exception {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String getSource(Class<?> sourceClazz) {
|
private String getSource(Class<?> sourceClazz) {
|
||||||
if (sourceClazz.isAnonymousClass()) {
|
return sourceClazz.isAnonymousClass() ? sourceClazz.getName() + " (Anonymous)" : sourceClazz.getName();
|
||||||
return sourceClazz.getName() + " (Anonymous)";
|
|
||||||
} else {
|
|
||||||
return sourceClazz.getName();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder("Please post this error to https://github.com/ViaVersion/ViaVersion/issues and follow the issue template\n{");
|
||||||
builder.append("Please post this error to https://github.com/ViaVersion/ViaVersion/issues and follow the issue template\n{");
|
boolean first = true;
|
||||||
int i = 0;
|
|
||||||
for (Map.Entry<String, Object> entry : info.entrySet()) {
|
for (Map.Entry<String, Object> entry : info.entrySet()) {
|
||||||
builder.append(i == 0 ? "" : ", ").append(entry.getKey()).append(": ").append(entry.getValue().toString());
|
if (!first) {
|
||||||
i++;
|
builder.append(", ");
|
||||||
}
|
}
|
||||||
builder.append("}\nActual Error: ");
|
builder.append(entry.getKey()).append(": ").append(entry.getValue());
|
||||||
|
first = false;
|
||||||
return builder.toString();
|
}
|
||||||
|
return builder.append("}\nActual Error: ").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren