Raise error if agread fails (returns null pointer)