Fixes #1187 - Protect against NPEs when validating rule builders

(cherry picked from commit b622c3d59f0b19bdc678883750afbfa67852bc3a)
Merge branch 'BroadleafCommerce-3.0.x' into BroadleafCommerce-3.1.x