diff --git a/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryManager.cs b/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryManager.cs index 2811da845..ae045e7c7 100644 --- a/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryManager.cs +++ b/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryManager.cs @@ -226,15 +226,24 @@ public void InitAllLoadedLibraries() { WebLibraryDetail web_lib = pair.Value; Library library = web_lib.Xlibrary; - ASSERT.Test(library == null); + // only set up a Library instance when there isn't already one. + // `library` may already have been set up in a previous call to this API + // at application start; *this* call therefor MUST be due to the user + // CREATING or JOINING another Intranet Library then! + if (library == null) + { + if (ShutdownableManager.Instance.IsShuttingDown) + { + Logging.Info("InitAllLoadedLibraries: Breaking out of library loading loop due to application termination"); + break; + } - if (ShutdownableManager.Instance.IsShuttingDown) + library = web_lib.Xlibrary = new Library(web_lib); + } + else { - Logging.Info("InitAllLoadedLibraries: Breaking out of library loading loop due to application termination"); - break; + Logging.Info($"InitAllLoadedLibraries: Initializing the local library for library Id: '{web_lib.Id}', Title: '{web_lib.Title}'"); } - - library = web_lib.Xlibrary = new Library(web_lib); library.BuildFromDocumentRepository(web_lib); } }