wizards/source/sfdocuments/SF_Base.xba |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b352ce86679d8ee751f57dc34ca808a62712e3b1
Author:     Jean-Pierre Ledure <j...@ledure.be>
AuthorDate: Thu Sep 28 15:03:32 2023 +0200
Commit:     Jean-Pierre Ledure <j...@ledure.be>
CommitDate: Thu Sep 28 17:20:41 2023 +0200

    ScriptForge (SF_Base) tdf#156599 Error message when loading a form
    
    Error occurs in SF_Base.IsLoaded(...)
    "Object variable not set"
    
    When user scripts run the method repeatedly from
    nearly simultaneous events, it might happen
    that the _FormDocuments private variable is
    not initialized.
    
    Simultaneous calls may be interpreted as internal
    calls. Internal calls do not execute the "Check"
    part of the published API.
    Hence the failing initialization.
    
    Solution: force the initialization of that specific
    variable at each run.
    
    Change-Id: I489cbaed7b8e57d6876b7af4b26f5be0beb3db69
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157374
    Reviewed-by: Jean-Pierre Ledure <j...@ledure.be>
    Tested-by: Jenkins
    (cherry picked from commit 3ce1237c0149d05e993eaac41634ce5dfe2ccca6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157319

diff --git a/wizards/source/sfdocuments/SF_Base.xba 
b/wizards/source/sfdocuments/SF_Base.xba
index 5c8c909b8cf2..b7662b7341cd 100644
--- a/wizards/source/sfdocuments/SF_Base.xba
+++ b/wizards/source/sfdocuments/SF_Base.xba
@@ -415,10 +415,10 @@ Const cstSubArgs = &quot;FormDocument&quot;
        bLoaded = False
 
 Check:
+       If IsNull(_FormDocuments) Then Set _FormDocuments = 
_Component.getFormDocuments()
        If ScriptForge.SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then
                If Not _IsStillAlive() Then GoTo Finally
                &apos;  Build list of available FormDocuments recursively with 
_CollectFormDocuments
-               If IsNull(_FormDocuments) Then Set _FormDocuments = 
_Component.getFormDocuments()
                vFormNames = Split(_CollectFormDocuments(_FormDocuments), 
cstToken)
                If Not ScriptForge.SF_Utils._Validate(FormDocument, 
&quot;FormDocument&quot;, V_STRING, vFormNames) Then GoTo Finally
        End If

Reply via email to