Fix input widget when query is None.

This avoids `TypeError: 'NoneType' object is not iterable` when adding
a collection.