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

ItemStack.toString() gives NullPointerException at Bukkit.getItemFactory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • None
    • None
    • 1.14.4-R0.1-SNAPSHOT-20190826.092815-45
    • Yes

      Running this snippet:

      ItemStack itemStack = new ItemStack(Material.DIAMOND, 1);
      System.out.println(itemStack.toString());
      

      Gives this error:

       

      java.lang.NullPointerExceptionjava.lang.NullPointerException at 
      org.bukkit.Bukkit.getItemFactory(Bukkit.java:1121) at 
      org.bukkit.inventory.ItemStack.hasItemMeta(ItemStack.java:540) at
      org.bukkit.inventory.ItemStack.toString(ItemStack.java:236) at 
      com.github.gjvnq.BidCraft.Model.OrderTest.execute(MyCode.java:21)

       

            Unassigned Unassigned
            gjvnq G Queiroz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: