Fix T51336: Crash on broken file opening.

`screen_findedge()` is not expected to return NULL in that case, but
checking against that does not hurt (we do it in all its other call
cases anyway), better than crashing.
This commit is contained in:
Bastien Montagne 2017-05-22 12:06:38 +02:00
parent bd09b51379
commit baf788d7cd
Notes: blender-bot 2023-02-14 07:01:30 +01:00
Referenced by issue #51336, Crash on file open
1 changed files with 6 additions and 2 deletions

View File

@ -766,7 +766,9 @@ static void screen_test_scale(bScreen *sc, int winsize_x, int winsize_y)
/* lower edge */
const int yval = sa->v2->vec.y - headery_init;
se = screen_findedge(sc, sa->v4, sa->v1);
select_connected_scredge(sc, se);
if (se != NULL) {
select_connected_scredge(sc, se);
}
for (sv = sc->vertbase.first; sv; sv = sv->next) {
if (sv != sa->v2 && sv != sa->v3) {
if (sv->flag) {
@ -779,7 +781,9 @@ static void screen_test_scale(bScreen *sc, int winsize_x, int winsize_y)
/* upper edge */
const int yval = sa->v1->vec.y + headery_init;
se = screen_findedge(sc, sa->v2, sa->v3);
select_connected_scredge(sc, se);
if (se != NULL) {
select_connected_scredge(sc, se);
}
for (sv = sc->vertbase.first; sv; sv = sv->next) {
if (sv != sa->v1 && sv != sa->v4) {
if (sv->flag) {