Cloudy & Associates

Commit b482e505 authored by Chatzikos, Marios's avatar Chatzikos, Marios
Browse files

Guard against missing files in db-ref-json2tex.pl

This occurs when computing the number of lines in the TeX table.
parent 61bd30bb
......@@ -54,6 +54,8 @@
# ./db-ref-json2tex.pl -nr=35 -e -d
#
# Chatzikos, 2016-Jan-28
# Chatzikos, 2022-Apr-12
# Bugfix: Count TeX rows only if data ref exists
#
use warnings;
......@@ -224,13 +226,17 @@ sub get_nrows_in_TeX_table
my $ref = $$species{ref};
my %nrows;
$nrows{energy} = @{ $$ref{energy} };
$nrows{trans} = @{ $$ref{trans} };
$nrows{coll} = @{ $$ref{coll} };
my $nrows = $nrows{energy};
$nrows = $nrows{trans} if( $nrows{trans} > $nrows );
$nrows = $nrows{coll} if( $nrows{coll} > $nrows );
$nrows{energy} = @{ $$ref{energy} } if( exists $$ref{energy} );
$nrows{trans} = @{ $$ref{trans} } if( exists $$ref{trans} );
$nrows{coll} = @{ $$ref{coll} } if( exists $$ref{coll} );
my $nrows = 0;
$nrows = $nrows{energy}
if( exists $nrows{energy} and $nrows{energy} > $nrows );
$nrows = $nrows{trans}
if( exists $nrows{trans} and $nrows{trans} > $nrows );
$nrows = $nrows{coll}
if( exists $nrows{coll} and $nrows{coll} > $nrows );
return ( $nrows, { %nrows } );
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment