hasLayer not checking for null

Return false when checking for a null object in L.Map.hasLayer.

Issue #1282 asks for an implementation.