Skip to content

Commit 6ca5e5b

Browse files
authored
Merge 5c68b23 into 9b5fa21
2 parents 9b5fa21 + 5c68b23 commit 6ca5e5b

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

source/vision/visionHandler.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# A part of NonVisual Desktop Access (NVDA)
33
# This file is covered by the GNU General Public License.
44
# See the file COPYING for more details.
5-
# Copyright (C) 2018-2019 NV Access Limited, Babbage B.V.
5+
# Copyright (C) 2018-2022 NV Access Limited, Babbage B.V., Cyrille Bougot
66

77
"""Module containing the vision handler.
88
@@ -283,6 +283,14 @@ def initializeProvider(
283283
# We should handle this more gracefully, since this is no reason
284284
# to stop a provider from loading successfully.
285285
log.debugWarning("Error in initial focus after provider load", exc_info=True)
286+
try:
287+
self.initialNavigatorObject()
288+
except Exception:
289+
# initialNavigatorObject might fail in case NVDA's current navigator object is an object
290+
# for which property fetching raises an exception.
291+
# We should handle this more gracefully, since this is no reason
292+
# to stop a provider from loading successfully.
293+
log.debugWarning("Error in initial navigator object after provider load", exc_info=True)
286294

287295
def terminate(self) -> None:
288296
self.extensionPoints = None
@@ -348,3 +356,9 @@ def initialFocus(self) -> None:
348356
# focus/review hasn't yet been initialized.
349357
return
350358
self.handleGainFocus(api.getFocusObject())
359+
360+
def initialNavigatorObject(self) -> None:
361+
if not api.getDesktopObject():
362+
# focus/review hasn't yet been initialized.
363+
return
364+
self.handleReviewMove(api.getNavigatorObject())

0 commit comments

Comments
 (0)