yuliskov / MediaServiceCore

Unofficial Java api for YouTube
43 stars 28 forks source link

Added null check for mMetaData.getBadgeStyles() in TileItem #7

Closed WarmElk closed 1 year ago

WarmElk commented 1 year ago

The music section doesn't load correctly for me. It briefly appears, but then disappears.

It looks like there was a recent commit to fix it, but it doesn't seem to work for me:

https://github.com/yuliskov/MediaServiceCore/commit/4648ff6c44d0c6413aa17d6ee42b6fd15c9bdb92

Running with that fix, the error log shows:

updateRowsHeader error: Attempt to invoke interface method 'java.lang.Object[] java.util.List.toArray(java.lang.Object[])' on a null object reference

After debugging, I found that the previous null check looks to be still required for mMetadata.getBadgeStyles(), as well as the new one for mMetadata, because that field can also be null. I've tested this along with the latest commit, 6b601ed, locally on an Nvidia Shield 2017, and this change allows the section to load for me.

Let me know if you need more information or have any questions.