Code: Select all
if OldCurrentItem.Flag = flUsed then
CurrentItem := OldCurrentItem;The old version do not have the if line.
I myself had changed the code to below to prevent the exception.
Code: Select all
if (OldCurrentItem = nil) or (OldCurrentItem.Flag = flUsed) then
CurrentItem := OldCurrentItem;