From 56bb18951aa3e032fdb3d33db57a4c2c6f181c46 Mon Sep 17 00:00:00 2001 From: digimer Date: Sun, 22 Oct 2023 00:11:24 -0400 Subject: [PATCH] Hopefully fixed an empty variable bug in duplicate variable searches. Signed-off-by: digimer --- Anvil/Tools/Database.pm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Anvil/Tools/Database.pm b/Anvil/Tools/Database.pm index 2b6a0ed4..0706f6f1 100644 --- a/Anvil/Tools/Database.pm +++ b/Anvil/Tools/Database.pm @@ -19695,8 +19695,8 @@ ORDER BY my $variable_uuid = $row->[0]; my $variable_section = $row->[1]; my $variable_name = $row->[2]; - my $variable_source_table = $row->[3] // "none"; - my $variable_source_uuid = $row->[4] // "none"; + my $variable_source_table = $row->[3] ? $row->[3] : "none"; + my $variable_source_uuid = $row->[4] ? $row->[4] : "none"; my $variable_value = $row->[5]; my $modified_date = $row->[6]; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { @@ -19709,6 +19709,17 @@ ORDER BY modified_date => $modified_date, }}); + if (not $variable_source_table) + { + $variable_source_table = "none"; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => { variable_source_table => $variable_source_table }}); + } + if (not $variable_source_uuid) + { + $variable_source_uuid = "none"; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => { variable_source_uuid => $variable_source_uuid }}); + } + if ((not exists $anvil->data->{duplicate_variables}{$variable_section}{$variable_name}{$variable_source_table}{$variable_source_uuid}) && (not exists $anvil->data->{duplicate_variables}{$variable_section}{$variable_name}{$variable_source_table}{$variable_source_uuid}{variable_uuid})) {