Skip to content

Commit

Permalink
Prevent a ClassCastException in ERTaggableEntity that would occur whe…
Browse files Browse the repository at this point in the history
…n using left outer joins for the tag relationships.
  • Loading branch information
fbarthez authored and darkv committed May 30, 2016
1 parent eb7a22f commit 301d97a
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.webobjects.eocontrol.EOSortOrdering;
import com.webobjects.foundation.NSArray;
import com.webobjects.foundation.NSDictionary;
import com.webobjects.foundation.NSKeyValueCoding;
import com.webobjects.foundation.NSMutableArray;
import com.webobjects.foundation.NSMutableDictionary;
import com.webobjects.foundation.NSMutableSet;
Expand Down Expand Up @@ -885,9 +886,11 @@ public NSDictionary<String, Integer> tagCount(EOEditingContext editingContext, N
NSMutableDictionary<String, Integer> tagCounts = new NSMutableDictionary<String, Integer>();
NSArray<NSDictionary> rawRows = ERXEOAccessUtilities.rawRowsForSQLExpression(editingContext, _entity.model(), sqlExpression, fetchAttributes);
for (NSDictionary rawRow : rawRows) {
String name = (String) rawRow.objectForKey("tagName");
Integer nameCount = (Integer) rawRow.objectForKey("tagCount");
tagCounts.setObjectForKey(nameCount, name);
if (!NSKeyValueCoding.NullValue.equals(rawRow.objectForKey("tagName"))) {
String name = (String) rawRow.objectForKey("tagName");
Integer nameCount = (Integer) rawRow.objectForKey("tagCount");
tagCounts.setObjectForKey(nameCount, name);
}
}

return tagCounts;
Expand Down

0 comments on commit 301d97a

Please sign in to comment.