The issue was that the `merge_layers` function assumed that the `src_grease_pencil` always returns a drawing when calling `get_eval_drawing` which can return `nullptr`. The fix makes sure to check that the `src_drawing` exists. Pull Request: https://projects.blender.org/blender/blender/pulls/129074