xloader is optional, only copy it when it's there

Bug: 4295425
Change-Id: I90713c8ef8cf84698ee2b27aa2e9db6c1c7842c2
diff --git a/generate-factory-images-common.sh b/generate-factory-images-common.sh
index 0ff6868..2fc5ebf 100644
--- a/generate-factory-images-common.sh
+++ b/generate-factory-images-common.sh
@@ -54,7 +54,10 @@
 
 # Copy the various images in their staging location
 cp ${SRCPREFIX}$PRODUCT-img-$BUILD.zip tmp/$PRODUCT-$VERSION/image-$PRODUCT-$VERSION.zip
-cp tmp/RADIO/$XLOADERSRC tmp/$PRODUCT-$VERSION/xloader-$DEVICE-$XLOADER.img
+if test "$XLOADER" != ""
+then
+  cp tmp/RADIO/$XLOADERSRC tmp/$PRODUCT-$VERSION/xloader-$DEVICE-$XLOADER.img
+fi
 if test "$BOOTLOADERFILE" = ""
 then
   cp tmp/RADIO/$BOOTLOADERSRC tmp/$PRODUCT-$VERSION/bootloader-$DEVICE-$BOOTLOADER.img