Perhaps this should be `if (keys == null || keys.isEmpty()) {` In other words, if it failed to understand the argument or we got an empty array/object, then return nothing.