renderer/console: Catch NaN when drawing lines

If NaN occurs in the gradient calculation that means the given points
that should be connected with lines are equal and we don't need to draw.