-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Bug]: Call to a member function comment() on null #18
Comments
Thanks, I will fix this today 👍 |
Can you check latest version? |
@ewilan-riviere unfortunately, I found another file that gives a similar error, but this time it's To be honest, it's somewhat unusual, and without looking at the code a bit, I wouldn't know why it's happening. It's supposed to be the case that $v2 should never be null in This time, it happened with a Tag ID3v2.4 (ID3v2.4), which has several empty fields, including the genre. Checking for $v2 as we do with comment works, but seems weird to have to check $v2 on every field. |
I will fix this, if you have a sample to provide for tests (if you can share it), it would be great! |
Thanks! Can I let these files into tests files? |
No, they are not mine and have copyright 🙃 |
No problem, I will create sample from their metadata. |
Can you test with latest version? |
Yep, seems to work fine. Thank you! 🙏 |
No problem, tell me if you find another bug! |
What happened?
It seems that when an .mp3 file only has ID3v2 information and no v1, the following error is generated:
The relevant line is:
php-audio/src/Models/AudioCore.php
Line 430 in 327e76d
In this case, the function is being called as:
fromId3(NULL, Object)
. Replacing the line with:comment: $v2 ? $v2->comment() : $v1->comment()
, works.How to reproduce the bug
For now I think it happens when a .mp3 file only has only ID3v2 information and no v1.
Package Version
3.0.02
PHP Version
8.2.11
Which operating systems does with happen with?
Windows
Notes
Really nice work, thank you!
The text was updated successfully, but these errors were encountered: