From 9a6b4e8dbb720e00c3d3ccd6b6f8b756425c508e Mon Sep 17 00:00:00 2001 From: SimasTuzinas Date: Wed, 30 Jan 2019 13:16:36 +0200 Subject: [PATCH] Windows crash fix (#175) * Fixing crash on UWP app Adding try catch block for numberOfCopies property * adding copies property in nubmerOfCopies --- src/windows/PrinterProxy.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/windows/PrinterProxy.js b/src/windows/PrinterProxy.js index 725b1cd..4064328 100644 --- a/src/windows/PrinterProxy.js +++ b/src/windows/PrinterProxy.js @@ -114,7 +114,11 @@ exports.onPrintTaskRequested = function (event) { task.options.duplex = Printing.PrintDuplex.oneSided; } - task.options.numberOfCopies = config.copies || 1; + // handling exception to prevent app to crash + try { + task.options.numberOfCopies = config.copies || 1; + } catch (e) { + } task.oncompleted = function (e) { exports._func(e.detail[0].completion == 3);