Fix T81806: Cycles error when GPU device_type is NONE
Own regression in 4bea4702d5
This commit is contained in:
parent
29dbe00719
commit
4d9f357bf6
Notes:
blender-bot
2023-02-14 06:00:47 +01:00
Referenced by issue #81806, Error getting Cycles GPU devices if device_type is set to NONE
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue