fix(VPN): 操作连接列表时增加判空处理(bug#185833)

This commit is contained in:
zhangyuanyuan1 2023-08-10 10:19:40 +08:00
parent 4cf54f01df
commit 34a3e43a83
1 changed files with 4 additions and 0 deletions

View File

@ -507,6 +507,10 @@ int Vpn::getInsertPos(QString connName)
auto dbusArg = result.arguments().at(0).value<QDBusArgument>();
QVector<QStringList> variantList;
dbusArg >> variantList;
if (variantList.isEmpty()) {
qDebug() << "[Vpn] virtualList is empty, getInsertPos return 0";
return 0;
}
for (int i = 0; i < variantList.size(); ++i ) {
if (variantList.at(i).at(0) == connName) {
qDebug() << "pos in kylin-nm is " << i;