I am using the following line of code to spawn a firework.
location.getWorld().spawn(location, Firework.class);
Which generated an exception java.lang.NullPointerException; with a stack trace as follows (executed from below to top):
at net.minecraft.server.v1_11_R1.EntityFireworks.<init>(EntityFireworks.java:33) ~[spigot.jar:git-Spigot-d60de0a-a951a88]
at org.bukkit.craftbukkit.v1_11_R1.CraftWorld.createEntity(CraftWorld.java:1150) ~[spigot.jar:git-Spigot-d60de0a-a951a88]
at org.bukkit.craftbukkit.v1_11_R1.CraftWorld.spawn(CraftWorld.java:1183) ~[spigot.jar:git-Spigot-d60de0a-a951a88]
at org.bukkit.craftbukkit.v1_11_R1.CraftWorld.spawn(CraftWorld.java:850) ~[spigot.jar:git-Spigot-d60de0a-a951a88]