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

Unexpected NullPointerExceptions with API objects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Major Major
    • None
    • None
    • 1.13.2-R0.1-SNAPSHOT
    • Yes

      While running working code, a NullPointerException randomly pops off.
      This happened me in two different periods with two different methods, first with Bukkit#getScoreboardManager(), secondly with World#getTime(), but both times in a scheduled thread.
      The error happens during a random period, doesn't disappear after relaunching the server, but disappears as randomly as it appeared.

      I'll report any new appearance of the bug if I get another one, and with the more details I can.

      Appearance:

      Loaded my plugin at 22:41:36.
      Logged in at 22:41:36.
      The error appeared at 22:41:44 and lasted until reload at 22:42:38.
      The code worked before and after the appearance of the bug without modification.

      Traceback example

      [22:42:23 WARN]: [Plugin] Task #2 for Plugin v0.1 generated an exception
       java.lang.NullPointerException: null
       at fr.artichaut.plugin.PluginInstance.refreshScoreboard(PluginInstancejava:25) ~[?:?]
       at org.bukkit.craftbukkit.v1_13_R2.scheduler.CraftTask.run(CraftTask.java:81) ~[spigot-1.13.2.jar:git-Spigot-518206a-a5b9c7b]
       atorg.bukkit.craftbukkit.v1_13_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:391) [spigot-1.13.2.jar:git-Spigot-518206a-a5b9c7b]
       at net.minecraft.server.v1_13_R2.MinecraftServer.b(MinecraftServer.java:888) [spigot-1.13.2.jar:git-Spigot-518206a-a5b9c7b]
       at net.minecraft.server.v1_13_R2.DedicatedServer.b(DedicatedServer.java:417) [spigot-1.13.2.jar:git-Spigot-518206a-a5b9c7b]
       at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:830) [spigot-1.13.2.jar:git-Spigot-518206a-a5b9c7b]
       at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:728) [spigot-1.13.2.jar:git-Spigot-518206a-a5b9c7b]
       at java.lang.Thread.run(Thread.java:844) [?:?]

      (The method which threw the exception was here World#getTime())

       

      Thanks a lot for considering this issue.
      Sincerely,
      LeSeulArtichaut

            Unassigned Unassigned
            LeSeulArtichaut LeSeulArtichaut
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: