Skip to content

Commit 53ddedb

Browse files
committed
fix crash on null color legend
(refs: #746 & #756)
1 parent a8496dd commit 53ddedb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/legends.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ function legendColor(color, {
4646
legend = true,
4747
...options
4848
}) {
49+
if (color?.domain === undefined) return;
4950
if (legend === true) legend = color.type === "ordinal" ? "swatches" : "ramp";
50-
if (color.domain === undefined) return;
5151
switch (`${legend}`.toLowerCase()) {
5252
case "swatches": return legendSwatches(color, options);
5353
case "ramp": return legendRamp(color, options);

0 commit comments

Comments
 (0)