From 3f31a86d6a1dd1f951d3c064aaefeae2b8d27c44 Mon Sep 17 00:00:00 2001 From: Oskar Szafraniec Date: Thu, 26 Oct 2017 13:10:08 +0200 Subject: [PATCH] 'NoneType' object has no attribute 'split' --- lg.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lg.py b/lg.py index ab2dcfe..9d2559b 100644 --- a/lg.py +++ b/lg.py @@ -437,7 +437,10 @@ def show_bgpmap(): e = edges[edge_tuple] label_without_star = kwargs["label"].replace("*", "") - labels = e.get_label().split("\r") + if e.get_label() is not None: + labels = e.get_label().split("\r") + else: + return edges[edge_tuple] if "%s*" % label_without_star not in labels: labels = [ kwargs["label"] ] + [ l for l in labels if not l.startswith(label_without_star) ] labels = sorted(labels, cmp=lambda x,y: x.endswith("*") and -1 or 1)