Skip to content

Commit

Permalink
fix table search when TableDescr is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
b4tman committed Sep 5, 2022
1 parent 4793d4d commit 1f19ed8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions PasswordChanger1C/DatabaseAccess8214.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ public static void ReadDataFromTable(InfobaseBinaryReader reader, long DB, ref P
int descrLength = Math.Min((int)PageHeader.Length, PageSize / 2);
TableDescr = Encoding.Unicode.GetString(PageBuffer, 0, descrLength);
var ParsedString = ParserServices.ParsesClass.ParseString(TableDescr);
if (0 == ParsedString.Count || 0 == ParsedString[0].Count)
{
return;
}

string TableName = ParsedString[0][0].ToString().Replace("\"", "").ToUpper();
PageHeader.TableName = TableName;
if (TableName != TargetTableName)
Expand Down
5 changes: 5 additions & 0 deletions PasswordChanger1C/DatabaseAccess838.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ private static AccessFunctions.PageParams FindTableDefinition(InfobaseBinaryRead
}

var TableDefinition = ParserServices.ParsesClass.ParseString(StrDefinition.ToString());
if (0 == TableDefinition.Count || 0 == TableDefinition[0].Count)
{
continue;
}

if (TableDefinition[0][0].ToString().ToUpper() == TargetTable)
{
Page.TableDefinition = StrDefinition.ToString();
Expand Down

0 comments on commit 1f19ed8

Please sign in to comment.