Fix: GPU: Crash in pygpu_batch_draw

Introduced by `3d8854b021195fdb253c85133b1db350d3d4c753`.
`py_shader` could still be `nullptr` and needs to be checked.
This commit is contained in:
Falk David
2025-05-23 12:31:04 +02:00
parent 0ad79ca541
commit 4901f38400

View File

@@ -321,7 +321,7 @@ static PyObject *pygpu_batch_draw(BPyGPUBatch *self, PyObject *args)
/* Emit a warning when trying to draw wide lines as it is too late to automatically switch to a
* polyline shader. */
if (py_shader->is_builtin &&
if (py_shader && py_shader->is_builtin &&
ELEM(self->batch->prim_type, GPU_PRIM_LINES, GPU_PRIM_LINE_STRIP, GPU_PRIM_LINE_LOOP))
{
GPUShader *shader = py_shader->shader;