fix crash in multi-camera export dialog when a camera group has an invalid or default icon

This commit is contained in:
Josh Hawkins
2026-07-15 11:42:59 -05:00
parent 9d113c0644
commit 1a7078a7a2
2 changed files with 11 additions and 2 deletions
+5 -1
View File
@@ -153,11 +153,15 @@ export default function IconPicker({
}
type IconRendererProps = {
icon: IconType;
icon: IconType | undefined;
size?: number;
className?: string;
};
export function IconRenderer({ icon, size, className }: IconRendererProps) {
if (!icon) {
return null;
}
return <>{React.createElement(icon, { size, className })}</>;
}
+6 -1
View File
@@ -65,6 +65,7 @@ import { Textarea } from "../ui/textarea";
import { useNavigate } from "react-router-dom";
import { useIsAdmin } from "@/hooks/use-is-admin";
import { isReplayCamera } from "@/utils/cameraUtil";
import { isValidIconName } from "@/utils/iconUtil";
const EXPORT_OPTIONS = [
"1",
@@ -1066,7 +1067,11 @@ export function ExportContent({
}
>
<IconRenderer
icon={LuIcons[group.icon]}
icon={
isValidIconName(group.icon)
? LuIcons[group.icon]
: LuIcons.LuFolder
}
className="mr-2 size-4 text-secondary-foreground"
/>
<span className="truncate">{group.name}</span>