Fix crash when search results overflow for a file