Merge pull request #8919 from abextm/farming-null

timetracking: Don't crash when seeing a garbage varbit value
This commit is contained in:
Adam
2019-05-25 14:27:44 -04:00
committed by GitHub
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;