Fix crash in crappy 3rd party code