ItemStack.toString() gives NullPointerException at Bukkit.getItemFactory

XMLWordPrintable

    • Type: Bug
    • Resolution: Done
    • Priority: Minor
    • None
    • Affects Version/s: None
    • Environment:
    • 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)

       

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

              Created:
              Updated:
              Resolved: