Avoid calling lines method on nil variable