From 23bb407a4f0db71eb15cbf8bbb8e82e02088a998 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 8 Nov 2008 19:09:54 +0000 Subject: Don't die if serialisation returns a NULL string. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1703 a436a847-0d15-0410-975c-d299462d15a1 --- src/serialisation/Serialiser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp index 96fe2632..cb9e36e4 100644 --- a/src/serialisation/Serialiser.cpp +++ b/src/serialisation/Serialiser.cpp @@ -150,8 +150,10 @@ Serialiser::finish() _model->serialise_to_file(_base_uri); } else { char* c_str = _model->serialise_to_string(); - ret = c_str; - free(c_str); + if (c_str != NULL) { + ret = c_str; + free(c_str); + } } _base_uri = ""; -- cgit v1.2.1