Logstash crashes with "comparison of String with 0 failed"

OK, I've been working on this for a while with tech support and my own testing. Here is the current situation:
Upgraded to LS 7.0
That changed the error above to 'no implicit conversion of nil into Integer'
But either way, I've narrowed the error down to below:

For THIS function:

         if [site_rank] and [site_rank]!="" and [site_rank] > 0 {

                  mutate {

                          add_tag => ["top1M"]

                  }

          }

if the site_rank field has NOT been populated for some reason, I get the 'no implicit conversion of nil into Integer' error. And the conditional statements above do not seem to prevent the error.

Also tried

     if [site_rank] and [site_rank]!="" {

           if [site_rank] > 0 {

              mutate {

                      add_tag => ["top1M"]

              }

           }

      }

So, how do I check to see if site_rank is nil?
Is this the solution: Logstash convert Nil values into a number