mirror of
https://github.com/comatory/fb2iCal
synced 2025-06-05 22:09:25 +02:00
fix problem in LDJSON parser when address object is not available
This commit is contained in:
@ -9,13 +9,17 @@ const parseEventData = (eventData) => {
|
||||
const { location } = eventData || {}
|
||||
const { address } = location || {}
|
||||
|
||||
const locationStr = location ? [
|
||||
location.name || '',
|
||||
const locationName = location ? location.name : ''
|
||||
const addressStr = address ? [
|
||||
address.streetAddress || '',
|
||||
address.addressLocality || '',
|
||||
address.postalCode || '',
|
||||
address.addressCountry || '',
|
||||
].join(' ') : ''
|
||||
const locationStr = [
|
||||
locationName,
|
||||
addressStr,
|
||||
].join(' ')
|
||||
const cleanedLocationStr = locationStr.replace(/\r?\n|\r/g, ' ')
|
||||
const title = eventData.name || ''
|
||||
const url = eventData.url || ''
|
||||
|
Reference in New Issue
Block a user