From 4bba693cd5d8aa37d210d56127d5171692d83790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Katzer?= Date: Wed, 13 Feb 2019 12:08:03 +0100 Subject: [PATCH] Safely set the copies property --- src/ios/APPPrinterInfo.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ios/APPPrinterInfo.m b/src/ios/APPPrinterInfo.m index d056bc8..6c71b87 100644 --- a/src/ios/APPPrinterInfo.m +++ b/src/ios/APPPrinterInfo.m @@ -21,6 +21,8 @@ #include "APPPrinterInfo.h" +#import + @implementation APPPrinterInfo #pragma mark - @@ -71,7 +73,10 @@ info.duplex = UIPrintInfoDuplexNone; } - [info setValue:[NSNumber numberWithLong:copies] forKey:@"_copies"]; + if (class_getProperty(info.class, "copies")) + { + [info setValue:[NSNumber numberWithLong:copies] forKey:@"_copies"]; + } if (jobName) {