Fix null safety issues

This commit is contained in:
gpt-engineer-app[bot]
2025-11-04 22:57:49 +00:00
parent c15efd7907
commit ae22a48ce2
4 changed files with 24 additions and 8 deletions

View File

@@ -17,6 +17,9 @@ export function RichParkDisplay({ data, actionType, showAllFields = true }: Rich
const [propertyOwner, setPropertyOwner] = useState<string | null>(null);
useEffect(() => {
// Guard against null/undefined data
if (!data) return;
const fetchRelatedData = async () => {
// Fetch location
if (data.location_id) {

View File

@@ -22,6 +22,9 @@ export function RichRideDisplay({ data, actionType, showAllFields = true }: Rich
const [showTechnical, setShowTechnical] = useState(false);
useEffect(() => {
// Guard against null/undefined data
if (!data) return;
const fetchRelatedData = async () => {
if (data.park_id) {
const { data: parkData } = await supabase