From 203f2619e1c15d16f73d2a1ea80d7e8e8f55bbb3 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Tue, 27 Jan 2015 22:31:12 +0000 Subject: [PATCH] Fix crash when creating a new file --- src/bin/edi_content_provider.c | 3 +++ src/bin/edi_main.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bin/edi_content_provider.c b/src/bin/edi_content_provider.c index fba6811..f17a9ac 100644 --- a/src/bin/edi_content_provider.c +++ b/src/bin/edi_content_provider.c @@ -58,6 +58,9 @@ Edi_Content_Provider *edi_content_provider_for_mime_get(const char *mime) { char *id; + if (!mime) + return NULL; + if (!strcasecmp(mime, "text/plain") || !strcasecmp(mime, "application/x-shellscript")) id = "text"; else if (!strcasecmp(mime, "text/x-chdr") || !strcasecmp(mime, "text/x-csrc") diff --git a/src/bin/edi_main.c b/src/bin/edi_main.c index 24f04ee..80346df 100644 --- a/src/bin/edi_main.c +++ b/src/bin/edi_main.c @@ -447,7 +447,7 @@ _tb_new_create_cb(void *data, path = edi_project_file_path_get(name); fclose(fopen(path, "w")); - edi_mainview_open_path(path); + edi_mainview_open_path(eina_stringshare_add(path)); evas_object_del(_edi_new_popup); free((char*)path);