Skip to content

Commit

Permalink
fix #3
Browse files Browse the repository at this point in the history
  • Loading branch information
acid1103 committed Oct 1, 2020
1 parent ba1b667 commit 1827f78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/abitoff/pdfinverter/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static void main(String[] args) throws IOException

// default to black
Integer backgroundRGB = 0x000000;
if (args[2] != null)
if (args.length > 2 && args[2] != null)
{
try
{
Expand All @@ -71,7 +71,7 @@ public static void main(String[] args) throws IOException
}
}

boolean invertImages = args[3] != null ? Boolean.parseBoolean(args[3]) : true;
boolean invertImages = (args.length > 3 && args[3] != null) ? Boolean.parseBoolean(args[3]) : true;

// convert background to float array. in the future, i plan on allowing increased bit-depth. floats offer a bit
// depth of about 24 bits in the range [0.0, 1.0], which is a greater bit depth than most standards i'm aware of
Expand Down

0 comments on commit 1827f78

Please sign in to comment.