Prevent an invalid pointer state in docloader.