enforce null check

If call to moment() returns null, you can't call startOf() / endOf()