diff options
author | Moonchild <moonchild@palemoon.org> | 2021-12-17 22:13:49 +0100 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-04-07 23:57:37 +0200 |
commit | e1a982d677f03e9afe291452e3ce8a241a13c248 (patch) | |
tree | 7c34de804495c7d1c1d43ac26b4aab4ae7593088 /toolkit | |
parent | b76d12c2bd9a823bfd536763493e25eb56adb5b5 (diff) | |
download | uxp-e1a982d677f03e9afe291452e3ce8a241a13c248.tar.gz |
No issue - Fix a potential autocomplete issue.
Account for the case where we don't have a tree view in selectedIndex
setter which may break future autocompletes.
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/content/widgets/autocomplete.xml | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/toolkit/content/widgets/autocomplete.xml b/toolkit/content/widgets/autocomplete.xml index da2bf678d4..885eb2eab4 100644 --- a/toolkit/content/widgets/autocomplete.xml +++ b/toolkit/content/widgets/autocomplete.xml @@ -780,7 +780,12 @@ onget="return this.tree.currentIndex;"> <setter> <![CDATA[ - this.tree.view.selection.select(val); + if (!this.tree.view) { + // We don't have a view? return "no selection". + val = -1; + } else { + this.tree.view.selection.select(val); + } if (this.tree.treeBoxObject.height > 0) this.tree.treeBoxObject.ensureRowIsVisible(val < 0 ? 0 : val); // Fire select event on xul:tree so that accessibility API |