hasLayer not checking for null

Return false when checking for a null object in L.Map.hasLayer, in
response to issue #1282.