Repository: nvaccess/nvda

Issue:
Thunderbird: certain characters with some HTML codes break braille output in the compose window
### Steps to reproduce:
1. Open Thunderbird.
2. Create a new message (CTRL+n).
3. Set the focus on the message body field.
4. Insert the following HTML code from Insertion menu (alt+i) → HTML... (H).
   `<div>😄<br /><hr /><a href="https://nvaccess.org/">nvaccess.org</a></div>`
  Please note that this is an intentionally minimal HTML code. I originally encountered this bug with more complex codes.
5. Once back on the message body field, press uparrow to go the first line.

### Actual behavior:
Braille output is not refreshed and the following is raised in the log (speech output OK):

<details><summary>Log</summary>

```
IO - inputCore.InputManager.executeGesture (11:58:43.062) - winInputHook (14280):
Input: kb(laptop):upArrow
DEBUG - editableText.EditableText._hasCaretMoved (11:58:43.117) - MainThread (12080):
Caret move detected using bookmarks. Elapsed: 0 ms
ERROR - scriptHandler.executeScript (11:58:43.162) - MainThread (12080):
error executing script: <bound method EditableText.script_caret_moveByLine of <NVDAObjects.Dynamic_EditableTextWithAutoSelectDetectionDocumentEditorMozillaIAccessible object at 0x08AD8470>> with gesture 'flèche haut'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 208, in executeScript
  File "editableText.pyc", line 224, in script_caret_moveByLine
  File "editableText.pyc", line 163, in _caretMovementScriptHelper
  File "NVDAObjects\behaviors.pyc", line 177, in _caretScriptPostMovedHelper
  File "editableText.pyc", line 149, in _caretScriptPostMovedHelper
  File "speech\speech.pyc", line 1128, in speakTextInfo
  File "speech\types.pyc", line 42, in __iter__
  File "speech\speech.pyc", line 1168, in getTextInfoSpeech
  File "NVDAObjects\IAccessible\ia2TextMozilla.pyc", line 390, in getTextWithFields
  File "NVDAObjects\IAccessible\ia2TextMozilla.pyc", line 329, in _getText
  File "NVDAObjects\IAccessible\ia2TextMozilla.pyc", line 261, in _iterRecursiveText
  File "NVDAObjects\IAccessible\ia2TextMozilla.pyc", line 38, in _getRawTextInfo
AttributeError: 'NoneType' object has no attribute 'role'
```

</details>

### Expected behavior:
Braille output should be updated, no error.

### System configuration
#### NVDA installed/portable/running from source:
Installed

#### NVDA version:
alpha-23069,94b8fa28

#### Windows version:
21H1

#### Name and version of other software in use when reproducing the issue:
Thunderbird 78.11.0 (64 bits)

#### Other information about your system:
N/A

### Other questions
#### Does the issue still occur after restarting your computer?
Yes

#### Have you tried any other versions of NVDA? If so, please report their behaviors.
No

#### If add-ons are disabled, is your problem still occurring?
Yes

#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Yes


Discussion:

Resolving patch:
diff --git a/source/NVDAObjects/IAccessible/ia2TextMozilla.py b/source/NVDAObjects/IAccessible/ia2TextMozilla.py
--- a/source/NVDAObjects/IAccessible/ia2TextMozilla.py
+++ b/source/NVDAObjects/IAccessible/ia2TextMozilla.py
@@ -270,6 +270,8 @@ def _iterRecursiveText(self, ti: offsets.OffsetsTextInfo, controlStack, formatCo
 				yield item
 			elif isinstance(item, int): # Embedded object.
 				embedded: typing.Optional[IAccessible] = _getEmbedded(ti.obj, item)
+				if embedded is None:
+					continue
 				notText = _getRawTextInfo(embedded) is NVDAObjectTextInfo
 				if controlStack is not None:
 					controlField = self._getControlFieldForObject(embedded)


Test patch: