Fix #31856: movieclips.load(filepath=None) or value crash Blender
Disallow running PyUnicode_EncodeFSDefault for None type which seems to be an issue on Windows.
This commit is contained in:
@@ -384,7 +384,10 @@ const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce)
|
||||
else {
|
||||
PyErr_Clear();
|
||||
|
||||
if (PyBytes_Check(py_str)) {
|
||||
if (py_str == Py_None) {
|
||||
return NULL;
|
||||
}
|
||||
else if (PyBytes_Check(py_str)) {
|
||||
return PyBytes_AS_STRING(py_str);
|
||||
}
|
||||
else if ((*coerce = PyUnicode_EncodeFSDefault(py_str))) {
|
||||
|
||||
Reference in New Issue
Block a user