Skip to content

Commit 3be4b55

Browse files
kendlingwmjordan
authored andcommitted
解决“添加字体筛选条件”对话框因为信息文件没有包含字体信息时导致崩溃的问题
如果选择的信息文件没有字体信息,如:<文档字体 /> 第 100 行的代码 _FontInfoBox.EnsureVisible(0); 会引起崩溃。
1 parent 97125bc commit 3be4b55

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

App/Functions/AutoBookmark/FontFilterForm.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ void OnLoad() {
9898
foreach (XmlElement item in _FontInfoBox.Roots) {
9999
_FontInfoBox.Expand(item);
100100
}
101-
_FontInfoBox.EnsureVisible(0);
102-
_FontInfoBox.Sort(_CountColumn, SortOrder.Descending);
101+
if (_FontInfoBox.GetItemCount() > 0) {
102+
_FontInfoBox.EnsureVisible(0);
103+
_FontInfoBox.Sort(_CountColumn, SortOrder.Descending);
104+
}
103105
}
104106

105107
void _OkButton_Click(Object source, EventArgs args) {

0 commit comments

Comments
 (0)