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:
2012-06-18 12:34:19 +00:00
parent a558eed3e4
commit 35b3736b16

View File

@@ -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))) {