Bug correction : throw a null pointer exception when
Foe reach the last point

Signed-off-by: xclam <romain.rj@gmail.com>