diff options
author | Kent Mein <mein@cs.umn.edu> | 2007-06-07 06:00:11 +0400 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2007-06-07 06:00:11 +0400 |
commit | 93a3b2b78a443c99cee9153cfff69127ed2fb336 (patch) | |
tree | 5217cb698c1d9966766ae162ca07e5e8621400af /source/blender/src/drawoops.c | |
parent | 25baab252c761a1ab5ed1d1ec66f9ea893a803f0 (diff) |
Some more coverity fixes.
This one moves some pointer checks up in the code
(they were after the pointer was used, kind of useless at that point) ;)
Kent
Diffstat (limited to 'source/blender/src/drawoops.c')
-rw-r--r-- | source/blender/src/drawoops.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/src/drawoops.c b/source/blender/src/drawoops.c index 1d9de264b61..ef32d2c7039 100644 --- a/source/blender/src/drawoops.c +++ b/source/blender/src/drawoops.c @@ -341,15 +341,15 @@ void draw_oops(Oops *oops) if(oops->id== (ID *)((G.scene->basact) ? (G.scene->basact->object) : 0)) line= 1; else if(oops->id== (ID *)G.scene) line= 1; + if (!oops->id) return; + if(oops->id->us) { cpack(body); glRectf(x1, y1, x2, y2); } - /* it has never happened that an oops was missing an ID at - this point but has occured elseware so lets be safe */ - if(oops->id && oops->id->lib) { + if(oops->id->lib) { if(oops->id->flag & LIB_INDIRECT) cpack(0x1144FF); else cpack(0x11AAFF); @@ -357,7 +357,7 @@ void draw_oops(Oops *oops) } v1[0]= x1; - v1[1] = y1; + v1[1] = y1; if(oops->type==ID_LI) { sprintf(str, " %s", ((Library *)oops->id)->name); @@ -430,6 +430,8 @@ void drawoopsspace(ScrArea *sa, void *spacedata) float col[3]; BIF_GetThemeColor3fv(TH_BACK, col); + + if(soops==0) return; /* darker background for oops */ if(soops->type!=SO_OUTLINER) { @@ -438,7 +440,6 @@ void drawoopsspace(ScrArea *sa, void *spacedata) glClearColor(col[0], col[1], col[2], 0.0); glClear(GL_COLOR_BUFFER_BIT); - if(soops==0) return; if(soops->type==SO_OUTLINER) draw_outliner(sa, soops); else { |