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

New commits:
commit bbe4d3498c2f994342b4d213f0ae874e7b0b7775
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 16:16:38 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

diff --git a/wizards/source/sfdocuments/SF_Base.xba 
b/wizards/source/sfdocuments/SF_Base.xba
index f96ddfd22e46..b6497b9b4f12 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