Fix NPE in CommandLineExample when there are no values to get for an index

Signed-off-by: Daniel Thomas <drt24@cam.ac.uk>