diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-05-22 13:06:38 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-05-22 13:08:03 +0300 |
commit | baf788d7cd1c4006a2f92531bf56cef2f601f75f (patch) | |
tree | 47ced45eece4c764bf686e4ceb8f2710e2d552ba /source/blender/editors | |
parent | bd09b51379ee1281cf94f94d2ca58b9658bb49e3 (diff) |
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.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 9d74299c10c..7d2b77028fc 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -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) { |