Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6726

NPE when calling getBossBar() on plugin spawned EnderDragon

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • 1.17.1
    • Yes

      Some EnderDragons may not have a dragonFight, so they do not have a bossbar.

       

      Caused by: java.lang.NullPointerException: Cannot read field "k" because "this.handle" is null
      at org.bukkit.craftbukkit.v1_17_R1.boss.CraftDragonBattle.getBossBar(CraftDragonBattle.java:29)
      at org.bukkit.craftbukkit.v1_17_R1.entity.CraftEnderDragon.getBossBar(CraftEnderDragon.java:69)
      at de.iani.security.commands.SpawnMobWithoutAI.spawnMob(SpawnMobWithoutAI.java:99)
      at de.iani.security.commands.SpawnMobWithoutAI.onCommand(SpawnMobWithoutAI.java:68)
      at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
      ... 21 more

       

      PR: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/925/overview

            Unassigned Unassigned
            Brokkonaut Brokkonaut
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: