mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2024-12-13 11:52:27 +00:00
Check that a variable is set before trying to use it
This commit is contained in:
parent
53543993c2
commit
f4fc0abf9f
1 changed files with 1 additions and 1 deletions
|
@ -427,7 +427,7 @@ function parseDiscogsRelease(data) {
|
|||
}
|
||||
|
||||
// Track number (only for Vinyl and Cassette)
|
||||
if ( release.discs[releaseNumber-1].format.match(/(Vinyl|Cassette)/)
|
||||
if (release.discs[releaseNumber-1].format && release.discs[releaseNumber-1].format.match(/(Vinyl|Cassette)/)
|
||||
&& discogsTrack.position.match(/^[A-Z]+[\.-]?\d*/) ){
|
||||
track.number = discogsTrack.position;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue