timetracking: Don't crash when seeing a garbage varbit value

This commit is contained in:
Max Weber
2019-05-24 17:42:29 -06:00
parent b616ef9eab
commit ea1b8fec97
2 changed files with 7 additions and 0 deletions

View File

@@ -187,6 +187,11 @@ public class FarmingTracker
PatchState state = patch.getImplementation().forVarbitValue(value);
if (state == null)
{
return null;
}
int stage = state.getStage();
int stages = state.getStages();
int tickrate = state.getTickRate() * 60;

View File

@@ -24,6 +24,7 @@
*/
package net.runelite.client.plugins.timetracking.farming;
import javax.annotation.Nullable;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.runelite.client.plugins.timetracking.Tab;
@@ -2576,6 +2577,7 @@ public enum PatchImplementation
}
};
@Nullable
abstract PatchState forVarbitValue(int value);
private final Tab tab;