From a756feed7300cbe5a0ef0d4d466a0cd7e81f3a1d Mon Sep 17 00:00:00 2001 From: Unknown <870709864@qq.com> Date: Sun, 16 Feb 2020 12:18:25 +0800 Subject: [PATCH] fix: linux run crash --- QtScrcpy/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/QtScrcpy/main.cpp b/QtScrcpy/main.cpp index 2ccb6a6..643eaaf 100644 --- a/QtScrcpy/main.cpp +++ b/QtScrcpy/main.cpp @@ -31,8 +31,10 @@ int main(int argc, char *argv[]) //update version QStringList versionList = QCoreApplication::applicationVersion().split("."); - QString version = versionList[0] + "." + versionList[1] + "." + versionList[2]; - a.setApplicationVersion(version); + if (versionList.size() >= 3) { + QString version = versionList[0] + "." + versionList[1] + "." + versionList[2]; + a.setApplicationVersion(version); + } installTranslator(); #if defined(Q_OS_WIN32) || defined(Q_OS_OSX)