Merge pull request #571 from pklite/loottracker-debug-msg

Prevents Loot Tracker from causing a NullPointer Exception on first run
This commit is contained in:
Lucwousin
2019-06-12 14:17:31 +02:00
committed by GitHub

View File

@@ -330,15 +330,17 @@ public class LootTrackerPlugin extends Plugin
lootRecords.addAll(RuneLiteAPI.GSON.fromJson(new FileReader(LOOT_RECORDS_FILE), lootRecords.addAll(RuneLiteAPI.GSON.fromJson(new FileReader(LOOT_RECORDS_FILE),
new TypeToken<ArrayList<LootRecord>>() new TypeToken<ArrayList<LootRecord>>()
{ }.getType())); { }.getType()));
} }
catch (IOException e) catch (IOException | NullPointerException e)
{ {
e.printStackTrace(); log.info("Couldn't load any locally stored loots.");
}
if (lootRecords.size() > 0)
{
log.info("Loaded {} locally stored loot records", lootRecords.size());
} }
} }
Collection<LootRecord> finalLootRecords = lootRecords; Collection<LootRecord> finalLootRecords = lootRecords;
clientThread.invokeLater(() -> clientThread.invokeLater(() ->
{ {