Drive-by nit: what's the `|| null` for?  Do we need to convert "" or undefined to null here for some reason?  Otherwise it seems redundant.