add a range check to avoid a crash that happens occasionally
add a range check to avoid a crash that happens occasionally

viroulep/RebirthItemTracker,Hyphen-ated/RebirthItemTracker,BrandonNowlin/RebirthItemTracker,johndrinkwater/RebirthItemTracker,BrandonNowlin/RebirthItemTracker,viroulep/RebirthItemTracker,Brett824/RebirthItemTracker,ArcticJoey/RebirthItemTracker,Zamiell/RebirthItemTracker,sillypears/RebirthItemTracker,Hyphen-ated/RebirthItemTrackerTest