Menu

#1 NullPointerException creating Video with null customFields

open
nobody
None
5
2010-02-10
2010-02-10
Dave
No

Not all videos on Brightcove have custom fields set on them, but I still needed to query for the field present. I found when I did so I got a NullPointerException in the Video(json) constructor. I fixed the issue with a simple if statement:

on Video.java, line 446, I added:
if(customKeys != null)
{
...
}
around the for loop for iterating through customKeys. In my case, customKeys was frequently null which caused the NPE.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB