From 4c7d33fc5a63a767be00b9f0460e6c2ceb0ddd67 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Fri, 7 Jan 2022 11:25:44 -0500 Subject: [PATCH] Guard empty printer tray names Closes #904 --- src/qz/printer/PrintOptions.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qz/printer/PrintOptions.java b/src/qz/printer/PrintOptions.java index 5714ab177..84e01250b 100644 --- a/src/qz/printer/PrintOptions.java +++ b/src/qz/printer/PrintOptions.java @@ -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"); }