Repository: nvaccess/nvda

Issue:
Errors raised when performing a say all where there is nothing to read
### Steps to reproduce:
1. Go to the desktop and perform a say all, or somewhere else where there is nothing to read
### Actual behavior:
Error sounds are heard
### Expected behavior:
<!--
Use "Speak command keys" (NVDA+4) and speech viewer to copy and paste here. 
Use braille viewer to copy and paste here.
You may additionally include an explanation.
-->
No error
### NVDA logs, crash dumps and other attachments:
Error log:
DEBUGWARNING - speech.sayAll._SayAllHandler.readText (21:25:57.692) - MainThread (23052):
Unable to make reader
Traceback (most recent call last):
  File "speech\sayAll.pyc", line 362, in getInitialTextInfo
  File "documentBase.pyc", line 74, in makeTextInfo
  File "textInfos\offsets.pyc", line 474, in __init__
  File "textInfos\offsets.pyc", line 253, in _getCaretOffset
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "speech\sayAll.pyc", line 110, in readText
  File "speech\sayAll.pyc", line 192, in __init__
  File "speech\sayAll.pyc", line 364, in getInitialTextInfo
NotImplementedError: ('Unable to make TextInfo: ', NotImplementedError())
ERROR - stderr (21:25:57.692) - MainThread (23052):
Exception ignored in:
ERROR - stderr (21:25:57.701) - MainThread (23052):
<function _TextReader.__del__ at 0x03A7C0C0>
ERROR - stderr (21:25:57.711) - MainThread (23052):
Traceback (most recent call last):
ERROR - stderr (21:25:57.719) - MainThread (23052):
  File "speech\sayAll.pyc", line 356, in __del__
ERROR - stderr (21:25:57.728) - MainThread (23052):
  File "speech\sayAll.pyc", line 349, in stop
ERROR - stderr (21:25:57.737) - MainThread (23052):
AttributeError
ERROR - stderr (21:25:57.744) - MainThread (23052):
:
ERROR - stderr (21:25:57.756) - MainThread (23052):
'_CaretTextReader' object has no attribute 'reader'
### System configuration
#### NVDA installed/portable/running from source:
Installed
#### NVDA version:
alpha-26412,28b47560
#### Windows version:
Windows 11, build Version 22H2 (OS Build 25188.1000)
#### Name and version of other software in use when reproducing the issue:
N/A
#### 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.
Yes, version prior to #14070 being merged work normally.
#### If NVDA 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:
@mltony - will you be able to investigate this?

Resolving patch:
diff --git a/source/speech/sayAll.py b/source/speech/sayAll.py
--- a/source/speech/sayAll.py
+++ b/source/speech/sayAll.py
@@ -187,6 +187,7 @@ class _TextReader(garbageHandler.TrackedObject, metaclass=ABCMeta):
 	MAX_BUFFERED_LINES = 10
 
 	def __init__(self, handler: _SayAllHandler):
+		self.reader = None
 		self.handler = handler
 		self.trigger = SayAllProfileTrigger()
 		self.reader = self.getInitialTextInfo()


Test patch: