loottracker: prevent null events
Also detect and log null events from the clue scroll reward interface
This commit is contained in:
@@ -54,6 +54,7 @@ import javax.inject.Inject;
|
|||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import lombok.NonNull;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
@@ -345,7 +346,7 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void addLoot(String name, int combatLevel, LootRecordType type, Collection<ItemStack> items)
|
void addLoot(@NonNull String name, int combatLevel, LootRecordType type, Collection<ItemStack> items)
|
||||||
{
|
{
|
||||||
final LootTrackerItem[] entries = buildEntries(stack(items));
|
final LootTrackerItem[] entries = buildEntries(stack(items));
|
||||||
SwingUtilities.invokeLater(() -> panel.add(name, type, combatLevel, entries));
|
SwingUtilities.invokeLater(() -> panel.add(name, type, combatLevel, entries));
|
||||||
@@ -429,6 +430,12 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
// Clue Scrolls use same InventoryID as Barrows
|
// Clue Scrolls use same InventoryID as Barrows
|
||||||
event = eventType;
|
event = eventType;
|
||||||
container = client.getItemContainer(InventoryID.BARROWS_REWARD);
|
container = client.getItemContainer(InventoryID.BARROWS_REWARD);
|
||||||
|
|
||||||
|
if (event == null)
|
||||||
|
{
|
||||||
|
log.debug("Clue scroll reward interface with no event!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case (WidgetID.KINGDOM_GROUP_ID):
|
case (WidgetID.KINGDOM_GROUP_ID):
|
||||||
event = "Kingdom of Miscellania";
|
event = "Kingdom of Miscellania";
|
||||||
|
|||||||
@@ -24,12 +24,14 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.loottracker;
|
package net.runelite.client.plugins.loottracker;
|
||||||
|
|
||||||
|
import lombok.NonNull;
|
||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
import net.runelite.http.api.loottracker.LootRecordType;
|
import net.runelite.http.api.loottracker.LootRecordType;
|
||||||
|
|
||||||
@Value
|
@Value
|
||||||
class LootTrackerRecord
|
class LootTrackerRecord
|
||||||
{
|
{
|
||||||
|
@NonNull
|
||||||
private final String title;
|
private final String title;
|
||||||
private final String subTitle;
|
private final String subTitle;
|
||||||
private final LootRecordType type;
|
private final LootRecordType type;
|
||||||
|
|||||||
Reference in New Issue
Block a user