Skip to content
Snippets Groups Projects
Commit ef5778ba authored by srosse's avatar srosse
Browse files

OO-114: fix NPE in publishing of deleted wiki course nodes id the archive container already exists

parent ea12110e
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,7 @@ import org.olat.core.util.notifications.SubscriptionContext;
import org.olat.core.util.vfs.LocalFolderImpl;
import org.olat.core.util.vfs.VFSContainer;
import org.olat.core.util.vfs.VFSLeaf;
import org.olat.core.util.vfs.VFSManager;
import org.olat.course.ICourse;
import org.olat.course.condition.Condition;
import org.olat.course.condition.interpreter.ConditionInterpreter;
......@@ -227,8 +228,13 @@ public class WikiCourseNode extends AbstractAccessableCourseNode {
}
String exportDirName = getShortTitle()+"_"+Formatter.formatDatetimeFilesystemSave(new Date(System.currentTimeMillis()));
VFSContainer destination = wikiExportContainer.createChildContainer(exportDirName);
if (destination==null) {
exportDirName = VFSManager.rename(wikiExportContainer, exportDirName);
destination = wikiExportContainer.createChildContainer(exportDirName);
}
if (destination==null) {
Tracing.logError("archiveNodeData: Could not create destination directory: wikiExportContainer="+wikiExportContainer+", exportDirName="+exportDirName, getClass());
return false;
}
VFSContainer container = WikiManager.getInstance().getWikiContainer(ores, WikiManager.WIKI_RESOURCE_FOLDER_NAME);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment