Check for null before checking length of context line

In IE within a setTimeout some of the context lines can be null.

Signed-off-by: Erik Hesselink <erik@silkapp.com>