Fix NPE in R8TestBuilder

Change-Id: Ide125cddbe6d07e74bd78b002593cb78f16a4dc4
diff --git a/src/test/testbase/java/com/android/tools/r8/R8TestBuilder.java b/src/test/testbase/java/com/android/tools/r8/R8TestBuilder.java
index be791e9..ecd1ea7 100644
--- a/src/test/testbase/java/com/android/tools/r8/R8TestBuilder.java
+++ b/src/test/testbase/java/com/android/tools/r8/R8TestBuilder.java
@@ -171,7 +171,7 @@
             residualArtProfiles,
             resourceShrinkerOutput,
             resourceShrinkerOutputForFeatures,
-            buildMetadata.get());
+            buildMetadata != null ? buildMetadata.get() : null);
     switch (allowedDiagnosticMessages) {
       case ALL:
         compileResult.getDiagnosticMessages().assertAllDiagnosticsMatch(new IsAnything<>());