Skip to content

null.## throws NPE #4311

@scabug

Description

@scabug

That might seem reasonable, except that the container classes all fail to check for null elements before calling ## on them, so for example List(null).## also throws. By contrast a java.util.ArrayList containing nulls hashes just fine.

Since this isn't a real method, it's easy to fix: add a null check to ScalaRunTime.hash(Any), returning zero.

Seeing this with Scala 2.8.1, but looking at the new code including Murmur hash I don't think anything's changed.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions