Closed pacoorozco closed 3 years ago
Google Photos API could return a empty MediaItem
when an error has occurred. In that case the response has a Status
addressing the problem.
It's documented here
In that case, we are going to skip this returned value.
Merged on master, v2.1.2
Describe the bug The bug was reported on gphotosuploader/gphotos-uploader-cli#262. In some cases (I don't know when) Google Photos response include no
MediaItem
. The code panics when it tries to access to a nil MediaItem.To Reproduce When creating a media item the lines:
If
result.NewMediaItemResults
has someMediaItem
pointing to nil, the code fails when it tries to access to it.Expected behavior It should not panic.
Additional context The Google Photos API documentation is not saying anything about
MediaItem
pointing to nil on successful responses..