Skip to content

Commit

Permalink
fix: crash caused by index out-of-range
Browse files Browse the repository at this point in the history
修复字母菜单尝试跳到目录时,遍历应用列表也未找到结果时,因
下标越界导致的访问数据为空所致崩溃。

Log:
  • Loading branch information
BLumia committed Nov 2, 2023
1 parent 626ff1d commit 4df3f1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qml/AppListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Item {
signal sectionHeaderClicked(var categoryType)

function scrollToAlphabetCategory(character) {
for (let i = 0; i <= model.count; i++) {
for (let i = 0; i < model.count; i++) {
let transliterated1st = model.model.data(model.modelIndex(i), 4096)[0].toUpperCase() // 4096 is AppsModel::TransliteratedRole
if (character === transliterated1st) {
// we use the highlight move to scroll to item
Expand Down

0 comments on commit 4df3f1a

Please sign in to comment.