Fix a potential NPE.
[3525] - Cannot modify existing criteria of a query that was created
using a form.