Fix segfault if error getting scans.