Reset storage endpoint to null on error

Reset endpoint to null so that the second time through the method doesn't return an empty string causing issues later on.