Allow L.snapshot to take non-existy values

`null` and `undefined` do not allow property reads (e.g. `null.foo`). So
without the existy check `L.snapshot(null)` and `L.snapshot(undefined)`
throw TypeErrors.