From 6259cc470eacd7d622467d5ac00677d8e3bb9efd Mon Sep 17 00:00:00 2001
From: Wei Liu <wliu5@unimelb.edu.au>
Date: Fri, 1 Nov 2024 18:39:08 +1100
Subject: [PATCH] fixed permission error when trying to check parent path when
 the parent is /projects collection asset.

---
 .../unimelb/mf/client/util/collection/CollectionPath.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main/java/unimelb/mf/client/util/collection/CollectionPath.java b/src/main/java/unimelb/mf/client/util/collection/CollectionPath.java
index b37a278..eb595a4 100644
--- a/src/main/java/unimelb/mf/client/util/collection/CollectionPath.java
+++ b/src/main/java/unimelb/mf/client/util/collection/CollectionPath.java
@@ -128,7 +128,9 @@ public class CollectionPath {
     }
 
     public synchronized CollectionDetails createIfNotExist(MFSession session, boolean createParents) throws Throwable {
-        CollectionUtils.createCollection(_path, createParents, true, session);
+    	if(!exists(session)) {
+            CollectionUtils.createCollection(_path, createParents, true, session);        	
+    	}
         return resolve(session, true);
     }
 }
-- 
GitLab