Skip to content

Commit

Permalink
development: fixed issue where returning Relationship and Actions may…
Browse files Browse the repository at this point in the history
… cause exception with returning an optional array that doesn't exist
  • Loading branch information
Daniel Dahan committed Nov 13, 2016
1 parent 8e5c5db commit 8528bdd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Graph.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Graph'
s.version = '2.0.3'
s.version = '2.0.4'
s.license = 'BSD-3-Clause'
s.summary = 'Graph is a semantic database that is used to create data-driven applications.'
s.homepage = 'http://graphswift.io'
Expand Down
18 changes: 6 additions & 12 deletions Sources/Entity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ public class Entity: Node {

/// A reference to all the Actions that the Entity is a part of.
public var actions: [Action] {
var s = Set<ManagedAction>()
s.formUnion(managedNode.actionSubjectSet as! Set<ManagedAction>)
var s = managedNode.actionSubjectSet as! Set<ManagedAction>
s.formUnion(managedNode.actionObjectSet as! Set<ManagedAction>)
return s.map {
return Action(managedNode: $0 as ManagedAction)
Expand Down Expand Up @@ -203,16 +202,11 @@ public class Entity: Node {

/// A reference to all the Relationships that the Entity is a part of.
public var relationships: [Relationship] {
var result: [Relationship]?
managedNode.managedObjectContext?.performAndWait { [unowned self] in
var set = Set<ManagedRelationship>()
set.formUnion(self.managedNode.relationshipSubjectSet as! Set<ManagedRelationship>)
set.formUnion(self.managedNode.relationshipObjectSet as! Set<ManagedRelationship>)
result = set.map {
return Relationship(managedNode: $0 as ManagedRelationship)
} as [Relationship]
}
return result!
var s = managedNode.relationshipSubjectSet as! Set<ManagedRelationship>
s.formUnion(managedNode.relationshipObjectSet as! Set<ManagedRelationship>)
return s.map {
return Relationship(managedNode: $0 as ManagedRelationship)
} as [Relationship]
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Sources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.0.3</string>
<string>2.0.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit 8528bdd

Please sign in to comment.