From 96ad287f01dc69ae1f98f2fd884fc0a97b1cc234 Mon Sep 17 00:00:00 2001
From: liweigang <izmirvii@gmail.com>
Date: Fri, 22 Mar 2024 09:48:17 +0800
Subject: [PATCH] fix: Array out of bounds causes crash handling

Signed-off-by: liweigang <izmirvii@gmail.com>
---
 src/frame/window/modules/systeminfo/systeminfowidget.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/frame/window/modules/systeminfo/systeminfowidget.cpp b/src/frame/window/modules/systeminfo/systeminfowidget.cpp
index 0d753d4..745fb19 100644
--- a/src/frame/window/modules/systeminfo/systeminfowidget.cpp
+++ b/src/frame/window/modules/systeminfo/systeminfowidget.cpp
@@ -95,6 +95,14 @@ void SystemInfoWidget::initData()
     connect(m_listView, &DListView::clicked, this, &SystemInfoWidget::onListClicked);
     connect(m_listView, &DListView::activated, m_listView, &DListView::clicked);
     connect(GSettingWatcher::instance(), &GSettingWatcher::requestUpdateSecondMenu, this, &SystemInfoWidget::onRequestUpdateSecondMenu);
+    if (IsServerSystem) {
+        connect(GSettingWatcher::instance(),
+                &GSettingWatcher::requestUpdateSecondMenu, this, [this](int row) {
+                    if (m_itemList.size() > row && m_itemList[row].gsettingsName == "editionLicense") {
+                        m_listView->setRowHidden(row, true);
+                    }
+                    });
+    }
 }
 
 DListView *SystemInfoWidget::getSystemListViewPointer()
-- 
2.33.1

