diff --git a/src/Datasets.jl b/src/Datasets.jl
index 69ade6469551642a4f9e4004cccc0fbdac1f07ee..89c158f44b1ce9964fa392407b71ec812ab854fd 100644
--- a/src/Datasets.jl
+++ b/src/Datasets.jl
@@ -763,7 +763,9 @@ function getprimarylabels(attributes::Attributes, attrname=LABEL_ATTRIBUTE_NAMES
             labels = labels[subattr]
         end
         if labels isa Vector
-            labels = [labels...]
+            if !isempty(labels)
+                labels = [labels...]
+            end
         else
             labels = [labels]
         end