From 3be4b55de94ba18c4f520c121b6e42827fed4de9 Mon Sep 17 00:00:00 2001 From: Kend Date: Wed, 28 Sep 2022 14:12:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E2=80=9C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6=E2=80=9D?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=A1=86=E5=9B=A0=E4=B8=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=B2=A1=E6=9C=89=E5=8C=85=E5=90=AB=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E4=BF=A1=E6=81=AF=E6=97=B6=E5=AF=BC=E8=87=B4=E5=B4=A9?= =?UTF-8?q?=E6=BA=83=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 如果选择的信息文件没有字体信息,如:<文档字体 /> 第 100 行的代码 _FontInfoBox.EnsureVisible(0); 会引起崩溃。 --- App/Functions/AutoBookmark/FontFilterForm.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/App/Functions/AutoBookmark/FontFilterForm.cs b/App/Functions/AutoBookmark/FontFilterForm.cs index ba65cfc0..b5d6529a 100644 --- a/App/Functions/AutoBookmark/FontFilterForm.cs +++ b/App/Functions/AutoBookmark/FontFilterForm.cs @@ -98,8 +98,10 @@ void OnLoad() { foreach (XmlElement item in _FontInfoBox.Roots) { _FontInfoBox.Expand(item); } - _FontInfoBox.EnsureVisible(0); - _FontInfoBox.Sort(_CountColumn, SortOrder.Descending); + if (_FontInfoBox.GetItemCount() > 0) { + _FontInfoBox.EnsureVisible(0); + _FontInfoBox.Sort(_CountColumn, SortOrder.Descending); + } } void _OkButton_Click(Object source, EventArgs args) {