Looks to fix the crafting crashes.

This implements WareXD's fix from #8763.  I'm pretty confident in it (else I wouldn't have filed the PR), but would ask whoever merges this to check it out for xemself, just to make sure.