From a66e4fbcb899b77e6eff1b5851ed0734c52784f5 Mon Sep 17 00:00:00 2001 From: bclothier Date: Sun, 2 Apr 2023 18:07:06 -0500 Subject: [PATCH] Avoid subscript out of range error due when aggressively sanitizing the XML due to lngLine going beyond the end of the UBound(varLines) --- Version Control.accda.src/modules/modSanitize.bas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Version Control.accda.src/modules/modSanitize.bas b/Version Control.accda.src/modules/modSanitize.bas index 3cd38e62..79f42bd7 100644 --- a/Version Control.accda.src/modules/modSanitize.bas +++ b/Version Control.accda.src/modules/modSanitize.bas @@ -601,7 +601,12 @@ Public Function SanitizeXML(strPath As String, blnReturnHash As Boolean) As Stri If Options.AggressiveSanitize Then Do While Not EndsWith(strTLine, "/>") lngLine = lngLine + 1 - strTLine = TrimTabs(Trim$(varLines(lngLine))) + If lngLine <= UBound(varLines) Then + strTLine = TrimTabs(Trim$(varLines(lngLine))) + Else + strTLine = vbNullString + Exit Do + End If Loop Else ' Keep line and continue