Prevent crashes due to missing or corrupted database records