Assert first before assign to result