#104, fix cases where bug sum could be nan

e.g empty functions or extern(C) functions
This commit is contained in:
Basile Burg 2016-11-19 09:23:58 +01:00
parent 6e10f889ee
commit f939160d08
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
1 changed files with 4 additions and 0 deletions

View File

@ -178,6 +178,8 @@ procedure THalsteadMetrics.Measure(document: TCESynMemo);
if val.isNil then
exit;
n1 := val.AsInteger;
if n1 = 0 then
exit;
val := obj.Find('n1Sum');
if val.isNil then
@ -188,6 +190,8 @@ procedure THalsteadMetrics.Measure(document: TCESynMemo);
if val.isNil then
exit;
n2 := val.AsInteger;
if n2 = 0 then
exit;
val := obj.Find('n2Sum');
if val.isNil then