Adds info messages to replace NPE's created by being unable to load any local loot tracker records

Signed-off-by: PKLite <stonewall@pklite.xyz>
This commit is contained in:
PKLite
2019-06-12 06:47:24 -04:00
parent bce942e50a
commit 899471e9be

View File

@@ -330,15 +330,17 @@ public class LootTrackerPlugin extends Plugin
lootRecords.addAll(RuneLiteAPI.GSON.fromJson(new FileReader(LOOT_RECORDS_FILE),
new TypeToken<ArrayList<LootRecord>>()
{ }.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;
clientThread.invokeLater(() ->
{