[Fix #1046] Handle ternary ops in Next cop