Fix a rare crash on resource requests. https://redmine.stoutner.com/issues/645