diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-10-19 15:58:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-10-19 16:09:51 +0300 |
commit | 4d9f357bf6b5cdd54d3d0406ef9ac79b387a21b5 (patch) | |
tree | be36aa49c8034fa07e54416edac8a5d02b6d4c9a /intern/cycles/blender | |
parent | 29dbe00719812925ab88030ce68509bf113520c5 (diff) |
Fix T81806: Cycles error when GPU device_type is NONE
Own regression in 4bea4702d5d5a
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/blender_python.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 021985bd2ba..525525e1047 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -410,7 +410,8 @@ static PyObject *available_devices_func(PyObject * /*self*/, PyObject *args) } DeviceType type = Device::type_from_string(type_name); - if ((type == DEVICE_NONE) && (type_name[0] != '\0')) { + /* "NONE" is defined by the add-on, see: `CyclesPreferences.get_device_types`. */ + if ((type == DEVICE_NONE) && (strcmp(type_name, "NONE") != 0)) { PyErr_Format(PyExc_ValueError, "Device \"%s\" not known.", type_name); return NULL; } |