Handle case if retryAttempt is null (db upgrade) #825