Update SlipstreamCLI.java

Fixed --patch without parameters (NullPointerException)
This commit is contained in:
SagePtr 2018-03-05 19:32:54 +02:00 committed by GitHub
parent 19233266d0
commit 871cbde44a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -233,22 +233,24 @@ public class SlipstreamCLI {
log.info( "Patching..." );
List<File> modFiles = new ArrayList<File>();
for ( String modFileName : slipstreamCmd.modFileNames ) {
File modFile = new File( modsDir, modFileName );
if ( slipstreamCmd.modFileNames != null ) {
for ( String modFileName : slipstreamCmd.modFileNames ) {
File modFile = new File( modsDir, modFileName );
if ( modFile.isDirectory() ) {
log.info( String.format( "Zipping dir: %s/", modFile.getName() ) );
try {
modFile = createTempMod( modFile );
deleteHook.addDoomedFile( modFile );
}
catch ( IOException e ) {
log.error( String.format( "Error zipping dir: %s/", modFile.getName() ), e );
System.exit( 1 );
if ( modFile.isDirectory() ) {
log.info( String.format( "Zipping dir: %s/", modFile.getName() ) );
try {
modFile = createTempMod( modFile );
deleteHook.addDoomedFile( modFile );
}
catch ( IOException e ) {
log.error( String.format( "Error zipping dir: %s/", modFile.getName() ), e );
System.exit( 1 );
}
}
modFiles.add( modFile );
}
modFiles.add( modFile );
}
boolean globalPanic = slipstreamCmd.globalPanic;