[CLJ-1339] Empty primitive vectors throw NPE on .equals with non-vector sequential types Created: 04/Feb/14 Updated: 14/Feb/14 Resolved: 14/Feb/14
|Affects Version/s:||Release 1.5|
|Fix Version/s:||Release 1.6|
|Patch:||Code and Test|
Primitive vectors have several equality cases. In the case where the compared value is not a vector or random access collection but is a sequential or list, an empty primitive vector will throw an NPE:
Cause: In this case of the primitive vector equals() method, seq is called on itself, then .equals() is invoked on the result. seq will return null for an empty primitive vector, causing an NPE.
Solution: Check for this condition and compare with (nil? (seq o)) on the other object.