diff options
author | David Robillard <d@drobilla.net> | 2011-03-08 02:41:58 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-03-08 02:41:58 +0000 |
commit | 058d88970bafcb97754dbc73880e24cd019f9a06 (patch) | |
tree | 9b35ba5a96e58a889220b9621f90119880ec4691 /src/sord.c | |
parent | 1e6424fb44d9c1c0f616117db1a17fe3618dcd36 (diff) | |
download | sord-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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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); |