mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-01-03 22:08:28 +00:00
Fix NPE when RTP center isn't set (#4251)
This commit is contained in:
parent
003d556f3d
commit
d4e194fbf7
1 changed files with 4 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
package com.earth2me.essentials;
|
||||
|
||||
import com.earth2me.essentials.config.EssentialsConfiguration;
|
||||
import com.earth2me.essentials.config.entities.LazyLocation;
|
||||
import com.earth2me.essentials.utils.LocationUtil;
|
||||
import com.earth2me.essentials.utils.VersionUtil;
|
||||
import io.papermc.lib.PaperLib;
|
||||
|
@ -40,9 +41,9 @@ public class RandomTeleport implements IConf {
|
|||
|
||||
public Location getCenter() {
|
||||
try {
|
||||
final Location center = config.getLocation("center").location();
|
||||
if (center != null) {
|
||||
return center;
|
||||
final LazyLocation center = config.getLocation("center");
|
||||
if (center != null && center.location() != null) {
|
||||
return center.location();
|
||||
}
|
||||
} catch (final InvalidWorldException ignored) {
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue