diff --git a/gns3server/controller/topology.py b/gns3server/controller/topology.py index b94dcff5..19835576 100644 --- a/gns3server/controller/topology.py +++ b/gns3server/controller/topology.py @@ -406,7 +406,7 @@ def _convert_label(label): """ Convert a label from 1.X to the new format """ - style = qt_font_to_style(label["font"], label["color"]) + style = qt_font_to_style(label.get("font"), label["color"]) return { "text": label["text"], "rotation": 0, diff --git a/gns3server/utils/qt.py b/gns3server/utils/qt.py index adb15124..1ec7850d 100644 --- a/gns3server/utils/qt.py +++ b/gns3server/utils/qt.py @@ -24,6 +24,8 @@ def qt_font_to_style(font, color): """ Convert a Qt font to CSS style """ + if font is None: + font = "TypeWriter,10,-1,5,75,0,0,0,0,0" font_info = font.split(",") style = "font-family: {};font-size: {};".format(font_info[0], font_info[1]) if font_info[4] == "75":