- if (path != NULL) {
- /* Path needs to be converted to UTF-16, so that the native chooser
- * can understand it. */
- path16 = g_utf8_to_utf16(path, -1, NULL, NULL, &error);
- if (error != NULL) {
- alertpanel_error(_("Could not convert file path to UTF-16:\n\n%s"),
- error->message);
- debug_print("file path '%s' conversion to UTF-16 failed\n", path);
- g_error_free(error);
- error = NULL;
- return FALSE;
- }
+ /* Path needs to be converted to UTF-16, so that the native chooser
+ * can understand it. */
+ path16 = g_utf8_to_utf16(path ? path : "",
+ -1, NULL, NULL, &error);
+ if (error != NULL) {
+ alertpanel_error(_("Could not convert file path to UTF-16:\n\n%s"),
+ error->message);
+ debug_print("file path '%s' conversion to UTF-16 failed\n", path);
+ g_error_free(error);
+ error = NULL;
+ return FALSE;