summaryrefslogtreecommitdiffstats
path: root/src/sord.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-03-08 02:41:58 +0000
committerDavid Robillard <d@drobilla.net>2011-03-08 02:41:58 +0000
commit058d88970bafcb97754dbc73880e24cd019f9a06 (patch)
tree9b35ba5a96e58a889220b9621f90119880ec4691 /src/sord.c
parent1e6424fb44d9c1c0f616117db1a17fe3618dcd36 (diff)
downloadsord-058d88970bafcb97754dbc73880e24cd019f9a06.tar.gz
sord-058d88970bafcb97754dbc73880e24cd019f9a06.tar.bz2
sord-058d88970bafcb97754dbc73880e24cd019f9a06.zip
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
Diffstat (limited to 'src/sord.c')
-rw-r--r--src/sord.c5
1 files changed, 4 insertions, 1 deletions
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);