SF.net SVN: geany-plugins:[2348] trunk/geany-plugins/gproject/src/ gproject-project.c

techet at users.sourceforge.net techet at xxxxx
Mon Nov 21 14:00:09 UTC 2011


Revision: 2348
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=2348&view=rev
Author:   techet
Date:     2011-11-21 14:00:08 +0000 (Mon, 21 Nov 2011)
Log Message:
-----------
Add more NULL-pointer checks to prevent crash when a project file is deleted

Modified Paths:
--------------
    trunk/geany-plugins/gproject/src/gproject-project.c

Modified: trunk/geany-plugins/gproject/src/gproject-project.c
===================================================================
--- trunk/geany-plugins/gproject/src/gproject-project.c	2011-11-20 17:53:12 UTC (rev 2347)
+++ trunk/geany-plugins/gproject/src/gproject-project.c	2011-11-21 14:00:08 UTC (rev 2348)
@@ -84,8 +84,11 @@
 		tm_obj = tm_source_file_new(locale_filename, FALSE, filetypes_detect_from_file(filename)->name);
 		g_free(locale_filename);
 
-		tm_workspace_add_object(tm_obj);
-		tm_source_file_update(tm_obj, TRUE, FALSE, TRUE);
+		if (tm_obj)
+		{
+			tm_workspace_add_object(tm_obj);
+			tm_source_file_update(tm_obj, TRUE, FALSE, TRUE);
+		}
 	}
 
 	if (obj->tag)
@@ -246,8 +249,11 @@
 		obj->tag = NULL;
 
 		path = tm_get_real_path(elem->data);
-		setptr(path, utils_get_utf8_from_locale(path));
-		g_hash_table_insert(g_prj->file_tag_table, path, obj);
+		if (path)
+		{
+			setptr(path, utils_get_utf8_from_locale(path));
+			g_hash_table_insert(g_prj->file_tag_table, path, obj);
+		}
 	}
 
 	if (g_prj->generate_tags)

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Plugins-Commits mailing list