Don't attempt to access cursor if it is closed.