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 {
11 11
12const { privacyData } = Astro.props; 12const { privacyData } = Astro.props;
13 13
14const priv = privacyData.parameters; 14const priv = privacyData?.parameters;
15 15
16const getIconName = (clasification: string) => { 16const getIconName = (clasification: string) => {
17 if (clasification === 'good') return 'faceGood'; 17 if (clasification === 'good') return 'faceGood';
@@ -23,7 +23,7 @@ const getIconName = (clasification: string) => {
23// If two or more objects in privacyPolicy.points have the same title, remove the duplicates 23// If two or more objects in privacyPolicy.points have the same title, remove the duplicates
24const removeDuplicates = () => { 24const removeDuplicates = () => {
25 const seen = new Set(); 25 const seen = new Set();
26 return priv.points = priv.points.filter((point) => { 26 return priv.points = (priv.points || []).filter((point) => {
27 if (seen.has(point.title)) { 27 if (seen.has(point.title)) {
28 return false; 28 return false;
29 } 29 }
web/src/pages/[...listing].astro +1 −1
@@ -265,7 +265,7 @@ const makeSoftwareSchema = () => {
265 privacyPolicyLink={privacyPolicyLink} 265 privacyPolicyLink={privacyPolicyLink}
266 /> 266 />
267 { 267 {
268 privacyData && privacyData.parameters.points.length > 0 && ( 268 privacyData && privacyData.parameters?.points?.length > 0 && (
269 <section> 269 <section>
270 <h2>{name} Privacy Policy</h2> 270 <h2>{name} Privacy Policy</h2>
271 <PrivacyPolicyDetails privacyData={privacyData} /> 271 <PrivacyPolicyDetails privacyData={privacyData} />