We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dace09c commit bc7abacCopy full SHA for bc7abac
Sources/PatternPreferences.swift
@@ -492,12 +492,14 @@ open class KVCPreferences: PreferencesAdapter {
492
}
493
494
open func keys() -> [String] {
495
- var names: [String] = []
496
var count: UInt32 = 0
497
// FIXME: not recursive?
498
- let properties = class_copyPropertyList(self.object.classForCoder, &count)
+ guard let properties = class_copyPropertyList(self.object.classForCoder, &count) else {
+ return []
499
+ }
500
+ var names: [String] = []
501
for i in 0 ..< Int(count) {
- let property: objc_property_t = properties![i]
502
+ let property: objc_property_t = properties[i]
503
let name: String = String(cString: property_getName(property))
504
names.append(name)
505
0 commit comments