mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2025-09-05 17:07:06 +02:00
Improve StringBuilder and also fix possible NPE
This commit is contained in:
@@ -160,7 +160,11 @@ public final class LocalExpansionManager implements Listener {
|
|||||||
@NotNull final Class<? extends PlaceholderExpansion> clazz) {
|
@NotNull final Class<? extends PlaceholderExpansion> clazz) {
|
||||||
try {
|
try {
|
||||||
final PlaceholderExpansion expansion = createExpansionInstance(clazz);
|
final PlaceholderExpansion expansion = createExpansionInstance(clazz);
|
||||||
|
|
||||||
|
if(expansion == null){
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
Objects.requireNonNull(expansion.getAuthor(), "The expansion author is null!");
|
Objects.requireNonNull(expansion.getAuthor(), "The expansion author is null!");
|
||||||
Objects.requireNonNull(expansion.getIdentifier(), "The expansion identifier is null!");
|
Objects.requireNonNull(expansion.getIdentifier(), "The expansion identifier is null!");
|
||||||
Objects.requireNonNull(expansion.getVersion(), "The expansion version is null!");
|
Objects.requireNonNull(expansion.getVersion(), "The expansion version is null!");
|
||||||
@@ -340,9 +344,11 @@ public final class LocalExpansionManager implements Listener {
|
|||||||
.append("placeholder hook(s) registered!");
|
.append("placeholder hook(s) registered!");
|
||||||
|
|
||||||
if (needsUpdate > 0) {
|
if (needsUpdate > 0) {
|
||||||
message.append("&6")
|
message.append(' ')
|
||||||
|
.append("&6")
|
||||||
.append(needsUpdate)
|
.append(needsUpdate)
|
||||||
.append(" placeholder hook(s) have an update available.");
|
.append(' ')
|
||||||
|
.append("placeholder hook(s) have an update available.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user