Skip to content

Commit

Permalink
Avoid potential NPE on WL0 (Grasscutters#1693)
Browse files Browse the repository at this point in the history
  • Loading branch information
Birdulon committed Aug 23, 2022
1 parent 6e35625 commit 5aaa1bd
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import emu.grasscutter.net.proto.VisionTypeOuterClass;
import emu.grasscutter.server.packet.send.PacketBlossomBriefInfoNotify;
import emu.grasscutter.utils.Utils;
import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;

Expand Down Expand Up @@ -127,7 +125,8 @@ public void initBlossom(EntityGadget gadget) {
public void notifyIcon() {
final int wl = getWorldLevel();
final int worldLevel = (wl < 0) ? 0 : ((wl > 8) ? 8 : wl);
final int monsterLevel = GameData.getWorldLevelDataMap().get(worldLevel).getMonsterLevel();
final var worldLevelData = GameData.getWorldLevelDataMap().get(worldLevel);
final int monsterLevel = (worldLevelData != null) ? worldLevelData.getMonsterLevel() : 1;
List<BlossomBriefInfoOuterClass.BlossomBriefInfo> blossoms = new ArrayList<>();
GameDepot.getSpawnLists().forEach((gridBlockId, spawnDataEntryList) -> {
int sceneId = gridBlockId.getSceneId();
Expand Down

0 comments on commit 5aaa1bd

Please sign in to comment.