changeset 2689:996281c0a457

Add a NULL check to avoid an idiotic crash. (This bug also revealed a problem in commandline handling - URIs are not constructed properly.)
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 06 Jun 2008 13:41:12 +0300
parents 17da667fb14d
children a8328c40a5c1
files src/modplug/archive/open.cxx
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/modplug/archive/open.cxx	Fri Jun 06 13:40:13 2008 +0300
+++ b/src/modplug/archive/open.cxx	Fri Jun 06 13:41:12 2008 +0300
@@ -19,8 +19,9 @@
 	string lExt;
 	uint32 lPos;
 	// convert from uri to fs based filepath
-	gchar *filename;
-	filename = g_filename_from_uri(aFileName.c_str(), NULL, NULL);
+	gchar *filename = g_filename_from_uri(aFileName.c_str(), NULL, NULL);
+	if (filename == NULL)
+		return new arch_Raw(aFileName);
 	string lRealFileName(filename);
 	g_free(filename);