fix compiler crash in error case
merge 0.18.x branch back into master