Fix crash switching render slots when there is only one slot

This commit is contained in:
Campbell Barton 2020-08-04 19:55:54 +10:00
parent 8d3b8bc835
commit a9e0aeaf65
Notes: blender-bot 2023-02-14 07:18:54 +01:00
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
1 changed files with 4 additions and 1 deletions

View File

@ -400,7 +400,10 @@ bool ED_image_slot_cycle(struct Image *image, int direction)
}
}
if (i == num_slots) {
if (num_slots == 1) {
image->render_slot = 0;
}
else if (i == num_slots) {
image->render_slot = ((cur == 1) ? 0 : 1);
}