The problem was we were checking isExpired() on the entry, but if it was expired at that point, then it would be null.