From 939962f8580ed7e5468085db3d8d958a878ded34 Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Wed, 17 Mar 2021 11:52:11 +0000 Subject: [PATCH] Check we can actually get a name --- Lib/fontTools/varLib/errors.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/fontTools/varLib/errors.py b/Lib/fontTools/varLib/errors.py index e06e29479..aa70b4786 100644 --- a/Lib/fontTools/varLib/errors.py +++ b/Lib/fontTools/varLib/errors.py @@ -34,7 +34,11 @@ class VarLibMergeError(VarLibError): def _master_name(self, ix): ttf = self.merger.ttfs[ix] - if "name" in ttf: + if ( + "name" in ttf + and ttf["name"].getDebugName(1) + and ttf["name"].getDebugName(2) + ): return ttf["name"].getDebugName(1) + " " + ttf["name"].getDebugName(2) elif hasattr(ttf.reader, "file") and hasattr(ttf.reader.file, "name"): return ttf.reader.file.name