@@ -214,7 +214,13 @@ public static void initSpark() {
214214 responseObject .addProperty ("total_finishes" , track .getTimeTrials ().getTotalFinishes ());
215215 responseObject .addProperty ("total_time_spent" , track .getTotalTimeSpent ());
216216 responseObject .addProperty ("weight" , track .getWeight ());
217- responseObject .addProperty ("gui_item" , track .getItem ().toString ());
217+ ItemStack trackItem = track .getItem ();
218+ if (trackItem == null ) {
219+ Messager .msgConsole ("&c[WARN] Track " + track .getCommandName () + " has a TrackItem that is null." );
220+ responseObject .addProperty ("gui_item" , "null" );
221+ } else {
222+ responseObject .addProperty ("gui_item" , track .getItem ().toString ());
223+ }
218224 JsonArray optionsArray = new JsonArray ();
219225 for (TrackOption option : track .getTrackOptions ().getTrackOptions ()) {
220226 optionsArray .add (option .toString ());
@@ -268,7 +274,13 @@ public static void initSpark() {
268274 responseObject .addProperty ("total_finishes" , track .getTimeTrials ().getTotalFinishes ());
269275 responseObject .addProperty ("total_time_spent" , track .getTotalTimeSpent ());
270276 responseObject .addProperty ("weight" , track .getWeight ());
271- responseObject .addProperty ("gui_item" , track .getItem ().toString ());
277+ ItemStack trackItem = track .getItem ();
278+ if (trackItem == null ) {
279+ Messager .msgConsole ("&c[WARN] Track " + track .getCommandName () + " has a TrackItem that is null." );
280+ responseObject .addProperty ("gui_item" , "null" );
281+ } else {
282+ responseObject .addProperty ("gui_item" , track .getItem ().toString ());
283+ }
272284 JsonArray optionsArray = new JsonArray ();
273285 for (TrackOption option : track .getTrackOptions ().getTrackOptions ()) {
274286 optionsArray .add (option .toString ());
0 commit comments