Add guard for empty linestrip, move dorun block inside let