From 058d88970bafcb97754dbc73880e24cd019f9a06 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 8 Mar 2011 02:41:58 +0000 Subject: Gracefully handle attempts to add broken quads (fix ticket #640). git-svn-id: http://svn.drobilla.net/sord/trunk@55 3d64ff67-21c5-427c-a301-fe4f08042e5a --- src/sord.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/sord.c') diff --git a/src/sord.c b/src/sord.c index f414c22..3152505 100644 --- a/src/sord.c +++ b/src/sord.c @@ -982,7 +982,10 @@ bool sord_add(SordModel sord, const SordQuad tup) { SORD_WRITE_LOG("Add " TUP_FMT "\n", TUP_FMT_ARGS(tup)); - assert(tup[0] && tup[1] && tup[2]); + if (!tup[0] || !tup[1] || !tup[2]) { + fprintf(stderr, "Attempt to add quad with NULL field.\n"); + return false; + } // FIXME: Remove double search SordIter existing = sord_find(sord, tup); -- cgit v1.2.1