diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 1b081c1..f037dc6 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -151,7 +151,7 @@ static guint signals[LAST_SIGNAL];
 
 static GdkAtom copied_files_atom;
 
-static char *scripts_directory_uri;
+static char *scripts_directory_uri = NULL;
 static int scripts_directory_uri_length;
 
 struct NautilusViewDetails
@@ -2271,34 +2271,33 @@ sort_directories_first_changed_callback (gpointer callback_data)
 }
 
 static void
-set_up_scripts_directory_global (void)
+set_up_scripts_directory_global (char **scripts_directory_path)
 {
-	char *scripts_directory_path;
 	const char *override;
 
 	if (scripts_directory_uri != NULL) {
 		return;
 	}
 
+	g_assert (scripts_directory_path != NULL);
+
 	override = g_getenv ("GNOME22_USER_DIR");
 
 	if (override) {
-		scripts_directory_path = g_build_filename (override,
+		*scripts_directory_path = g_build_filename (override,
 							   "nautilus-scripts",
 							   NULL);
 	} else {
-		scripts_directory_path = g_build_filename (g_get_home_dir (),
+		*scripts_directory_path = g_build_filename (g_get_home_dir (),
 							   ".gnome2",
 							   "nautilus-scripts",
 							   NULL);
 	}
 
-	if (g_mkdir_with_parents (scripts_directory_path, 0755) == 0) {
-		scripts_directory_uri = g_filename_to_uri (scripts_directory_path, NULL, NULL);
+	if (g_mkdir_with_parents (*scripts_directory_path, 0755) == 0) {
+		scripts_directory_uri = g_filename_to_uri (*scripts_directory_path, NULL, NULL);
 		scripts_directory_uri_length = strlen (scripts_directory_uri);
 	}
-
-	g_free (scripts_directory_path);
 }
 
 static void
@@ -2519,7 +2518,7 @@ nautilus_view_init (NautilusView *view)
 {
 	NautilusDirectory *scripts_directory;
 	NautilusDirectory *templates_directory;
-	char *templates_uri;
+	char *templates_uri, *scripts_directory_path;
 
 	view->details = g_new0 (NautilusViewDetails, 1);
 
@@ -2539,10 +2538,16 @@ nautilus_view_init (NautilusView *view)
 	gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (view), NULL);
 	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view), GTK_SHADOW_ETCHED_IN);
 
-	set_up_scripts_directory_global ();
+	scripts_directory_path = NULL;
+	set_up_scripts_directory_global (&scripts_directory_path);
 	scripts_directory = nautilus_directory_get_by_uri (scripts_directory_uri);
-	add_directory_to_scripts_directory_list (view, scripts_directory);
-	nautilus_directory_unref (scripts_directory);
+	if (scripts_directory != NULL) {
+		add_directory_to_scripts_directory_list (view, scripts_directory);
+		nautilus_directory_unref (scripts_directory);
+	} else {
+		g_warning ("Ignoring scripts directory \"%s\", it may be a broken link\n", scripts_directory_path);
+	}
+	g_free (scripts_directory_path);
 
 	if (nautilus_should_use_templates_directory ()) {
 		templates_uri = nautilus_get_templates_directory_uri ();
