diff --git a/openformats/formats/android.py b/openformats/formats/android.py index 1b45dd22..531e9de8 100644 --- a/openformats/formats/android.py +++ b/openformats/formats/android.py @@ -382,8 +382,9 @@ def compile(self, template, stringset, is_source=True, language_info=None, # This is needed in case the first tag is skipped to retain # the file's formating - first_tag_position = parsed.text_position + len(parsed.text) - self.transcriber.copy_until(first_tag_position) + if parsed.text and parsed.text_position: + first_tag_position = parsed.text_position + len(parsed.text) + self.transcriber.copy_until(first_tag_position) children_iterator = parsed.find_children( self.STRING,