Check value return from get_the_terms() to insure an array is submitted ...

...to CloudSearch... in addition to removing a ton of whitespace.  I can re-submit the pull request without the whitespace removal if desired.  The only functional change occurs on lines 320-323.