瀏覽代碼

Ignore some error messages

Yentl Van Tendeloo 8 年之前
父節點
當前提交
3ae507f640
共有 2 個文件被更改,包括 9 次插入2 次删除
  1. 8 2
      bootstrap/core_algorithm.alc
  2. 1 0
      bootstrap/modelling.alc

+ 8 - 2
bootstrap/core_algorithm.alc

@@ -258,8 +258,9 @@ String function get_entry_id(name : String):
 		return caches["root"]!
 
 	if (dict_in(caches["models"], name)):
-		if (full_name(caches["models"][name]) == name):
-			return caches["models"][name]!
+		if (dict_in(core, caches["models"])):
+			if (full_name(caches["models"][name]) == name):
+				return caches["models"][name]!
 
 	current = get_entry_id(get_foldername(name))
 
@@ -360,6 +361,11 @@ String function create_folders(user_id : String, folder_name : String):
 
 String function store_entry(model_id : String, full_name : String, user_id : String):
 	String prev
+
+	if (get_entry_id(full_name) != ""):
+		// Delete any old models
+		model_delete(get_entry_id(full_name))
+
 	prev = create_folders(user_id, get_foldername(full_name))
 	instantiate_link(core, "contains", "", prev, model_id)
 	return full_name!

+ 1 - 0
bootstrap/modelling.alc

@@ -403,6 +403,7 @@ Element function read_attribute(model : Element, element : String, attribute : S
 
 	else:
 		log("Element does not exist: " + element)
+		set_pop(set_create())
 
 	// Not found: either element doesn't exist, or we couldn't find it
 	return read_root()!