Skip to content

Commit

Permalink
Guard empty printer tray names
Browse files Browse the repository at this point in the history
Closes qzind#904
  • Loading branch information
tresf committed Jan 7, 2022
1 parent 6568249 commit 4c7d33f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/qz/printer/PrintOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ public PrintOptions(JSONObject configOpts, PrintOutput output, PrintingUtilities
}
if (!configOpts.isNull("printerTray")) {
psOptions.printerTray = configOpts.optString("printerTray", null);
// Guard empty string value; will break pattern matching
if(psOptions.printerTray != null && psOptions.printerTray.trim().equals("")) {
psOptions.printerTray = null;
}
}
if (!configOpts.isNull("rasterize")) {
try { psOptions.rasterize = configOpts.getBoolean("rasterize"); }
Expand Down

0 comments on commit 4c7d33f

Please sign in to comment.