Fix nullptr dereference in clean without exec context