check expression type in viewer to mitigate the void bug
This commit is contained in:
parent
f96f8de92a
commit
482ceb76dc
|
@ -59,6 +59,13 @@ export const ExpressionViewer: React.FC<Props> = ({
|
||||||
expression,
|
expression,
|
||||||
width,
|
width,
|
||||||
}) => {
|
}) => {
|
||||||
|
if (typeof expression !== "object") {
|
||||||
|
return (
|
||||||
|
<VariableList path={path} heading="Error">
|
||||||
|
{() => `Unknown expression: ${expression}`}
|
||||||
|
</VariableList>
|
||||||
|
);
|
||||||
|
}
|
||||||
switch (expression.tag) {
|
switch (expression.tag) {
|
||||||
case "number":
|
case "number":
|
||||||
return (
|
return (
|
||||||
|
@ -281,10 +288,16 @@ export const ExpressionViewer: React.FC<Props> = ({
|
||||||
);
|
);
|
||||||
default: {
|
default: {
|
||||||
return (
|
return (
|
||||||
<div>
|
<VariableList path={path} heading="Error">
|
||||||
<span>No display for type: </span>{" "}
|
{() => (
|
||||||
<span className="font-semibold text-slate-600">{expression.tag}</span>
|
<div>
|
||||||
</div>
|
<span>No display for type: </span>{" "}
|
||||||
|
<span className="font-semibold text-slate-600">
|
||||||
|
{expression.tag}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</VariableList>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user