[12361] Avoid crash and .pool command

(based on commit [12258] - cf0c023)