[Bf-blender-cvs] [0256d5d] id-remap: Fix reload/relocate trying to use invalid lib path.

Bastien Montagne noreply at git.blender.org
Thu Jun 16 17:17:17 CEST 2016


Commit: 0256d5dde9c77f40c6361900fb0682aa6d7127c7
Author: Bastien Montagne
Date:   Thu Jun 16 16:06:10 2016 +0200
Branches: id-remap
https://developer.blender.org/rB0256d5dde9c77f40c6361900fb0682aa6d7127c7

Fix reload/relocate trying to use invalid lib path.

===================================================================

M	source/blender/windowmanager/intern/wm_files_link.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index a4dea81..3709e10 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -740,6 +740,12 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload)
 
 		BLI_join_dirfile(path, sizeof(path), root, libname);
 
+		if (!BLI_exists(path)) {
+			BKE_reportf(op->reports, RPT_ERROR_INVALID_INPUT,
+			            "Trying to reload or relocate library '%s' to invalid path '%s'", lib->id.name, path);
+			return OPERATOR_CANCELLED;
+		}
+
 		if (BLI_path_cmp(lib->filepath, path) == 0) {
 #ifdef PRINT_DEBUG
 			printf("We are supposed to reload '%s' lib (%d)...\n", lib->filepath, lib->id.us);




More information about the Bf-blender-cvs mailing list