Both MathGlyphInfo and MathVariants can be None, so check for that first before trying to access their methods.