#446390 patch by mani.atico and me: improve rules condition to be more robust when checking for empty values