Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-03 14:50:30 +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(entry.getKey()).append(": ").append(entry.getValue());
|
||||||
|
first = false;
|
||||||
}
|
}
|
||||||
builder.append("}\nActual Error: ");
|
return builder.append("}\nActual Error: ").toString();
|
||||||
|
|
||||||
return builder.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren