15539710a0
from Michael Hitch in pr#1722. As noted in the pr, this may not be the most correct fix, but at least it prevents crashes.