Fix #2244 judge conditions