diff --git a/PyTeX/format/generic_text.py b/PyTeX/format/generic_text.py index dd6bbc1..94a644a 100644 --- a/PyTeX/format/generic_text.py +++ b/PyTeX/format/generic_text.py @@ -86,12 +86,14 @@ class GenericText: def __add__(self, other): if not self.has_value(): return other - if not other.has_value(): - return self if isinstance(other, GenericText): + if not other.has_value(): + return self return GenericText(self.text + other.text) else: return GenericText(self.text + other) - def __iadd__(self, other): - self.text = self + other + def __radd__(self, other): + if other is None: + return self + return other + self