As you can see, the result is 'yes', but my flag is 0, how could this happen? What can I do?
var img=imageCollection.filterBounds(geometry).filterDate('2021-08-09','2021-08-10').median();
print(img)
var flag=img.bandNames().size();
print(flag);
if(flag)
{
print('yes')
}