google/data-transfer-project

MediaContainerResource uses wrong variable in null check

jzacsh opened this issue · 0 comments

I have a commit to fix this - just wanted a bug to explain it. This came up with my tests in a draft branch started failing (but this bug itself is in master branch).

Here's the buggy line of code (its referencing photos in its ternary instead of videos): https://github.com/google/data-transfer-project/blob/94f427a1ed11f75527d5b782d4ade84ef1284557/portability-types-common/src/main/java/org/datatransferproject/types/common/models/media/MediaContainerResource.java#L34

here's the stacktrace of how this manifests in my branch's new unit test org.datatransferproject.transfer.microsoft.media.MicrosoftMediaImporterTest #testImportItemAllSuccess:

java.lang.NullPointerException
	at org.datatransferproject.types.common.models.media.MediaContainerResource.transmogrifyTitles(MediaContainerResource.java:90)
	at org.datatransferproject.types.common.models.media.MediaContainerResource.transmogrify(MediaContainerResource.java:70)
	at org.datatransferproject.transfer.microsoft.media.MicrosoftMediaImporter.importItem(MicrosoftMediaImporter.java:103)
	at org.datatransferproject.transfer.microsoft.media.MicrosoftMediaImporterTest.testImportItemAllSuccess(MicrosoftMediaImporterTest.java:229)