🥅 Catch potential errors

This commit is contained in:
Alicia Sykes
2022-02-12 21:28:27 +00:00
parent ca9498ba4a
commit 04082763d3
3 changed files with 7 additions and 2 deletions

View File

@@ -149,7 +149,7 @@ export default {
let sectionToReturn;
const parse = (section) => section.replaceAll(' ', '-').toLowerCase().trim();
allSections.forEach((section) => {
if (parse(sectionTitle) === parse(section.name)) {
if (parse(sectionTitle) === parse(section.name || '')) {
sectionToReturn = [section];
}
});