Introduced in version: 1.3 (29 Jan 2020)
‘This is very likely a bug and should be changed. There are only two correct ways to check for empty string
Noncompliant example:
$Str = empty and trim($Str) != ''
– equal used instead of not equal or other way around-
$Str = empty and trim($Str) = ''
–and
is used instead ofor
or other way around -
trim($Str) != ''and $Str != empty
– the order of expression is reversed resulting in a null pointer exception
Compliant example:
Only two ways how to correctly check for empty string
if $Str != empty and trim($Str) != '' then $Str else 'empty'
if $Str = empty or trim($Str) = '' then 'empty' else $Str