Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error cannot read property 'trim' of undefined in common.js file (Common.parseGenre) #149

Open
wants to merge 0 commits into
base: master
Choose a base branch
from

Conversation

KHALED-LAKEHAL
Copy link

Common.parseGenre = function(origVal) {
// test value
if (typeof origVal === 'undefined') return [];
else {
// match everything inside parentheses
var split = origVal.trim().split(/((.*?))/g).filter(function(val) {
return val !== '';
});
var array = [];
for (var _i = 0, split_1 = split; _i < split_1.length; _i++) {
var cur = split_1[_i];
if (/^\d+$/.test(cur) && !isNaN(parseInt(cur, 10))) {
cur = ID3v1Parser_1.Genres[cur];
}
array.push(cur);
}
return array
.filter(function(val) {
return val !== undefined;
}).join('/');
}
};

@Borewit
Copy link

Borewit commented Jul 21, 2017

@AlgeriaSoft Maybe your intention was to send this pull request to music-metadata?

@Borewit Borewit force-pushed the master branch 7 times, most recently from b4c12dd to 27d15ec Compare October 20, 2018 09:42
@Borewit Borewit force-pushed the master branch 6 times, most recently from e350cee to bd2dc53 Compare February 5, 2019 18:58
@Borewit Borewit force-pushed the master branch 2 times, most recently from 7a426f7 to 06f702a Compare August 21, 2019 13:41
@Borewit Borewit force-pushed the master branch 2 times, most recently from 46eee3c to 00bd746 Compare October 26, 2019 09:37
@Borewit Borewit force-pushed the master branch 3 times, most recently from da97422 to 83ca198 Compare December 25, 2019 12:57
@Borewit Borewit force-pushed the master branch 6 times, most recently from 280f2f4 to d9b4782 Compare January 4, 2020 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants