v.22.2Bug Fix

Fix potential crash during schema inference from URL source

Fix potential crash when doing schema inference from url source. Closes #34147. #34405 (Kruglov Pavel).