`if collection is None:` is probably more robust.