diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-07 08:35:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-07 08:35:26 +0400 |
commit | 7e068a16f08114151b299581c1071affe3d7a80f (patch) | |
tree | 23044eb60e65c4a234c703b2b05e31577925faf7 /source/blender/editors/space_node | |
parent | ec986b2c34f1c5bdd682ef5916760f55e1df6eca (diff) |
avoid divide by zeto in node preview drawing.
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index b40a7e4702e..6719e371d63 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -923,10 +923,13 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN } /* preview */ - if (node->flag & NODE_PREVIEW) { - bNodePreview *preview = previews ? BKE_node_instance_hash_lookup(previews, key) : NULL; - if (preview && preview->rect && !BLI_rctf_is_empty(&node->prvr)) - node_draw_preview(preview, &node->prvr); + if (node->flag & NODE_PREVIEW && previews) { + bNodePreview *preview = BKE_node_instance_hash_lookup(previews, key); + if (preview->xsize && preview->ysize) { + if (preview->rect && !BLI_rctf_is_empty(&node->prvr)) { + node_draw_preview(preview, &node->prvr); + } + } } UI_ThemeClearColor(color_id); |