Guard against empty docs