Browse Source

【注释】修复“创建Form签名默认值为空崩溃”

wanjun 1 year ago
parent
commit
22acd32c0a

+ 2 - 2
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFAnnotationExtensions/CPDFAnnotationModel.m

@@ -251,7 +251,7 @@
         } else if ([_annotation isKindOfClass:[CPDFRedactAnnotation class]]) {
             color = [(CPDFRedactAnnotation *)_annotation borderColor];
         } else {
-            color = self.annotation.color;
+            color = self.annotation.color ? : NSColor.blackColor;
         }
     } else {
         NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
@@ -259,7 +259,7 @@
             case CAnnotationTypeFreeText:
             case CAnnotationTypeSignText:
             case CAnnotationTypeSignDate:
-                color = [userDefaults PDFListViewColorForKey:CFreeTextNoteBorderColorKey];
+                color = [userDefaults PDFListViewColorForKey:CFreeTextNoteBorderColorKey] ? : NSColor.blackColor;
                 break;
             case CAnnotationTypeAnchored:
                 color = [userDefaults PDFListViewColorForKey:CAnchoredNoteColorKey];