Added missing ptr check.