summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-06-13 22:55:23 +0000
committerTavian Barnes <tavianator@gmail.com>2009-06-13 22:55:23 +0000
commit5e605e80937a02a55e2d2b94bce715ff937e0d26 (patch)
treed1b7334f94c0ce26127dd3d160c80a53c8ff84fd
parent9b85799fb274f291d4fefd9de08c069fe11d46f1 (diff)
downloaddimension-5e605e80937a02a55e2d2b94bce715ff937e0d26.tar.xz
Fix dmnsn_new_sphere failure symantics.
-rw-r--r--libdimension/sphere.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libdimension/sphere.c b/libdimension/sphere.c
index 4b99eaf..a14070e 100644
--- a/libdimension/sphere.c
+++ b/libdimension/sphere.c
@@ -29,8 +29,10 @@ dmnsn_object *
dmnsn_new_sphere()
{
dmnsn_object *sphere = dmnsn_new_object();
- sphere->intersections_fn = &dmnsn_sphere_intersections_fn;
- sphere->inside_fn = &dmnsn_sphere_inside_fn;
+ if (sphere) {
+ sphere->intersections_fn = &dmnsn_sphere_intersections_fn;
+ sphere->inside_fn = &dmnsn_sphere_inside_fn;
+ }
return sphere;
}