[DROOLS-50] fix combined use of memberOf and null safe dereferencing
(cherry picked from commit ef4dc900927df4c5d6b444e51224bebe56670256)