From 026b4f55e7102af12a223162803f41b3673a6abf Mon Sep 17 00:00:00 2001 From: chrys87 Date: Mon, 28 May 2018 09:59:18 +0200 Subject: [PATCH] Update attributeManager.py --- src/fenrirscreenreader/core/attributeManager.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/fenrirscreenreader/core/attributeManager.py b/src/fenrirscreenreader/core/attributeManager.py index 1b0d3ac6..ce2c15bc 100644 --- a/src/fenrirscreenreader/core/attributeManager.py +++ b/src/fenrirscreenreader/core/attributeManager.py @@ -9,7 +9,9 @@ from collections import Counter class attributeManager(): def __init__(self): - self.setDefaultAttributes() + self.currAttributes = None + self.prevAttributes = None + self.setDefaultAttributes() def initialize(self, environment): self.env = environment def shutdown(self): @@ -165,9 +167,12 @@ class attributeManager(): # no change if oldAttr == newAttr: return result, currCursor + # error case + if newAttr == None: + return result, currCursor # special case for pty if not text exists. if len(newAttr) == 0: - return result, currCursor + return result, currCursor textLines = text.split('\n')