mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-22 10:45:22 +01:00
Added defensive code for JUnit testing
This commit is contained in:
parent
8e68349004
commit
475f6372e2
@ -1646,7 +1646,8 @@ public class IslandsManager {
|
||||
* @param island - island
|
||||
*/
|
||||
public static void updateIsland(Island island) {
|
||||
if (handler.objectExists(island.getUniqueId())) {
|
||||
// When mocking, handler can be null so this null check avoids errors
|
||||
if (handler != null && handler.objectExists(island.getUniqueId())) {
|
||||
island.clearChanged();
|
||||
handler.saveObjectAsync(island)
|
||||
.thenAccept(b -> MultiLib.notify("bentobox-updateIsland", island.getUniqueId()));
|
||||
|
Loading…
Reference in New Issue
Block a user