Commit 52727cd6a3

52727cd6a3946cf63da74fc5576c7ae11adf5308

parent: 182161f985

Unsigned

Alicia Sykes <alicia@omg.lol> · 2026-05-12 17:13 UTC

Fix undefined when privacy policy empty

Layout: unified · split

web/src/components/things/PrivacyPolicyDetails.astro +2 −2
@@ -11,7 +11,7 @@ interface Props {
1111
1212const { privacyData } = Astro.props;
1313
14const priv = privacyData.parameters;
14const priv = privacyData?.parameters;
1515
1616const getIconName = (clasification: string) => {
1717 if (clasification === 'good') return 'faceGood';
@@ -23,7 +23,7 @@ const getIconName = (clasification: string) => {
2323// If two or more objects in privacyPolicy.points have the same title, remove the duplicates
2424const removeDuplicates = () => {
2525 const seen = new Set();
26 return priv.points = priv.points.filter((point) => {
26 return priv.points = (priv.points || []).filter((point) => {
2727 if (seen.has(point.title)) {
2828 return false;
2929 }
web/src/pages/[...listing].astro +1 −1
@@ -265,7 +265,7 @@ const makeSoftwareSchema = () => {
265265 privacyPolicyLink={privacyPolicyLink}
266266 />
267267 {
268 privacyData && privacyData.parameters.points.length > 0 && (
268 privacyData && privacyData.parameters?.points?.length > 0 && (
269269 <section>
270270 <h2>{name} Privacy Policy</h2>
271271 <PrivacyPolicyDetails privacyData={privacyData} />