From 9223ddbc3c9a1372ceb427b0e1cd6739198cf093 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 27 May 2014 13:54:42 +0200 Subject: [PATCH] Check for 0 pointer --- python/_cosmotool.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/_cosmotool.pyx b/python/_cosmotool.pyx index 488171b..5e8c5dc 100644 --- a/python/_cosmotool.pyx +++ b/python/_cosmotool.pyx @@ -133,6 +133,8 @@ def loadGadget(str filename, int snapshot_id, bool loadPosition = True, bool loa flags |= NEED_VELOCITY data = loadGadgetMulti(filename, snapshot_id, flags) + if data == 0: + return None simu = Simulation() simu.data = data