diff --git a/website/src/metadata_parser.js b/website/src/metadata_parser.js index 6a92a8a6..1e0c9680 100644 --- a/website/src/metadata_parser.js +++ b/website/src/metadata_parser.js @@ -1,6 +1,10 @@ const ALLOW_MANY = ['by', 'url', 'genre', 'license']; export function getMetadata(raw_code) { + if (raw_code == null) { + console.error('saved pattern is empty or corrupted') + raw_code = ''; + } const comment_regexp = /\/\*([\s\S]*?)\*\/|\/\/(.*)$/gm; const comments = [...raw_code.matchAll(comment_regexp)].map((c) => (c[1] || c[2] || '').trim()); const tags = {};