changeset 4807:859ef55f062c

Don't crash on an invalid interface.
author William Pitcock <nenolod@atheme.org>
date Thu, 16 Oct 2008 12:59:14 -0500
parents 563b6f48acd9
children 323b3d9c9b19
files src/audacious/main.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/main.c	Sat Nov 01 20:09:43 2008 +0100
+++ b/src/audacious/main.c	Thu Oct 16 12:59:14 2008 -0500
@@ -612,8 +612,13 @@
     g_message("Selecting interface %s", options.interface);
     i = interface_get(options.interface);
 
-    g_message("Running interface %s@%p", options.interface, i);
-    interface_run(i);
+    if (i != NULL)
+    {
+        g_message("Running interface %s@%p", options.interface, i);
+        interface_run(i);
+    }
+    else
+        g_print("%s: unable to launch selected interface %s\n", argv[0], options.interface);
 
     aud_quit();
     return EXIT_SUCCESS;