T357: Gracefully handle missing tags in M4A and OGG files.

This commit is contained in:
Peter Deltchev 2015-09-12 02:11:52 -07:00
parent 5f69cdda5b
commit 9b9f25dc51

View file

@ -451,7 +451,13 @@ class ImportMLPMA extends Command {
* @return array
*/
protected function getAtomTags($rawTags) {
$tags = $rawTags['tags']['quicktime'];
if (array_key_exists('tags', $rawTags) &&
array_key_exists('quicktime', $rawTags['tags'])) {
$tags = $rawTags['tags']['quicktime'];
} else {
$tags = [];
}
$trackNumber = null;
if (isset($tags['track_number'])) {
@ -480,7 +486,13 @@ class ImportMLPMA extends Command {
* @return array
*/
protected function getVorbisTags($rawTags) {
$tags = $rawTags['tags']['vorbiscomment'];
if (array_key_exists('tags', $rawTags) &&
array_key_exists('vorbiscomment', $rawTags['tags'])
) {
$tags = $rawTags['tags']['vorbiscomment'];
} else {
$tags = [];
}
$trackNumber = null;
if (isset($tags['track_number'])) {