Fix #147294: Crash when duplicating scene strip

Seems to have been introduced by 1104c69a0e.
In `BKE_paint_copy` the `src->runtime` can be `nullptr` in some cases.

This adds a check to make sure to only copy the settings
when `src->runtime` exists.

Pull Request: https://projects.blender.org/blender/blender/pulls/147304
This commit is contained in:
Falk David
2025-10-04 06:39:37 +02:00
committed by Falk David
parent f7c37b05e4
commit bbfcffb54d

View File

@@ -1911,9 +1911,11 @@ void BKE_paint_copy(const Paint *src, Paint *dst, const int flag)
}
dst->runtime = MEM_new<blender::bke::PaintRuntime>(__func__);
dst->runtime->paint_mode = src->runtime->paint_mode;
dst->runtime->ob_mode = src->runtime->ob_mode;
dst->runtime->initialized = true;
if (src->runtime) {
dst->runtime->paint_mode = src->runtime->paint_mode;
dst->runtime->ob_mode = src->runtime->ob_mode;
dst->runtime->initialized = true;
}
}
void BKE_paint_settings_foreach_mode(ToolSettings *ts, blender::FunctionRef<void(Paint *paint)> fn)