ugly workaround to test against -1 without crashing