summaryrefslogtreecommitdiff
path: root/src/plugins/python/pythonutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/python/pythonutils.cpp')
-rw-r--r--src/plugins/python/pythonutils.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/python/pythonutils.cpp b/src/plugins/python/pythonutils.cpp
index 6c8ff9bcba..ae4fd3a1f7 100644
--- a/src/plugins/python/pythonutils.cpp
+++ b/src/plugins/python/pythonutils.cpp
@@ -67,8 +67,8 @@ FilePath detectPython(const FilePath &documentPath)
// check whether this file is inside a python virtual environment
QList<Interpreter> venvInterpreters = PythonSettings::detectPythonVenvs(documentPath);
- if (!python.exists())
- python = venvInterpreters.value(0).command;
+ if (!python.exists() && !venvInterpreters.isEmpty())
+ python = venvInterpreters.first().command;
if (!python.exists())
python = PythonSettings::defaultInterpreter().command;