diff --git a/django/applications/catmaid/control/treenode.py b/django/applications/catmaid/control/treenode.py index b59d3cbf5e..da17e809ab 100644 --- a/django/applications/catmaid/control/treenode.py +++ b/django/applications/catmaid/control/treenode.py @@ -279,9 +279,11 @@ def insert_new_treenode(parent_id=None, skeleton_id=None): new_treenode.location_x = float(x) new_treenode.location_y = float(y) new_treenode.location_z = float(z) - new_treenode.radius = int(radius) + new_radius = int(radius if (radius and not math.isnan(radius)) else 0) + new_treenode.radius = new_radius new_treenode.skeleton_id = skeleton_id - new_treenode.confidence = int(confidence) + new_confidence = int(confidence if not math.isnan(confidence) and (confidence or confidence is 0) else 5) + new_treenode.confidence = new_confidence if parent_id: new_treenode.parent_id = parent_id new_treenode.save()