Lame little fix in case of lazy consumer code
authorskeezix <skeezix@flotsam-vm.(none)>
Thu, 12 Jan 2012 19:30:03 +0000 (14:30 -0500)
committerskeezix <skeezix@flotsam-vm.(none)>
Thu, 12 Jan 2012 19:30:03 +0000 (14:30 -0500)
lib/pnd_desktop.c

index 168ae74..be58955 100644 (file)
@@ -1008,6 +1008,14 @@ pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath, unsigned int flags ) {
   }
 #endif
 
   }
 #endif
 
+  // lame guards, in case of lazy consumers and broken .desktop files
+  if ( p -> object_path == NULL ) {
+    p -> object_path = strdup ( "/tmp" );
+  }
+  if ( p -> object_filename == NULL ) {
+    p -> object_filename = strdup ( "" ); // force bad filename
+  }
+
   // return disco-t
   return ( p );
 }
   // return disco-t
   return ( p );
 }