Fix: exception showing touch-pad preferences

Regression in [0] returned null without an exception set.

[0]: d9f38fca5f
This commit is contained in:
Campbell Barton
2025-03-26 15:34:07 +11:00
parent 9360884310
commit 6960d05df8

View File

@@ -613,6 +613,10 @@ static PyObject *bpy_wm_capabilities(PyObject *self)
PyObject *result = nullptr;
switch (PyObject_GetOptionalAttr(self, py_id_capabilities, &result)) {
case 1: {
BLI_assert(result != nullptr);
break;
}
case 0: {
result = PyDict_New();
const eWM_CapabilitiesFlag flag = WM_capabilities_flag();
@@ -633,9 +637,6 @@ static PyObject *bpy_wm_capabilities(PyObject *self)
PyObject_SetAttr(self, py_id_capabilities, result);
break;
}
case 0:
BLI_assert(result != nullptr);
break;
default:
/* Unlikely, but there may be an error, forward it. */
BLI_assert(result == nullptr);