Windows crash fix (#175)

* Fixing crash on UWP app

Adding try catch block for numberOfCopies property

* adding copies property in nubmerOfCopies
This commit is contained in:
SimasTuzinas 2019-01-30 13:16:36 +02:00 committed by Sebastián Katzer
parent c19cec7415
commit 9a6b4e8dbb

View File

@ -114,7 +114,11 @@ exports.onPrintTaskRequested = function (event) {
task.options.duplex = Printing.PrintDuplex.oneSided; task.options.duplex = Printing.PrintDuplex.oneSided;
} }
// handling exception to prevent app to crash
try {
task.options.numberOfCopies = config.copies || 1; task.options.numberOfCopies = config.copies || 1;
} catch (e) {
}
task.oncompleted = function (e) { task.oncompleted = function (e) {
exports._func(e.detail[0].completion == 3); exports._func(e.detail[0].completion == 3);