Fixes #1187 - Protect against NPEs when validating rule builders

(cherry picked from commit b622c3d59f0b19bdc678883750afbfa67852bc3a)