Skip to content

Commit

Permalink
Merge pull request #237 from serhatkarakoca/feature/media_content
Browse files Browse the repository at this point in the history
parse media content in xml
  • Loading branch information
rbren committed May 12, 2023
2 parents f23cfd9 + 0d97a30 commit eb8a4ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ class Parser {
item['rdf:about'] = xmlItem.$['rdf:about']
}
if (xmlItem.category) item.categories = xmlItem.category;

This comment has been minimized.

Copy link
@martinambrus

martinambrus Aug 13, 2023

this actually breaks the build, since if there is no xmlItem['media:content'][0].$ present, there's an TypeError: Cannot read properties of undefined (reading '0') error

var mediaContent = xmlItem['media:content'][0].$;
if(mediaContent) item.mediaContent = mediaContent;

this.setISODate(item);
return item;
}
Expand Down

0 comments on commit eb8a4ee

Please sign in to comment.