mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-25 15:51:12 -05:00
Fix null safety issues
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user