Skip to content

Commit fef3e61

Browse files
fix: do not let null per-call options clobber .percy.yml config in merge
Ref: PER-8053
1 parent 65470c8 commit fef3e61

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/main/java/io/percy/selenium/Percy.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,14 @@ public JSONObject snapshot(String name, Map<String, Object> options) {
383383
}
384384
}
385385
if (options != null) {
386-
mergedOptions.putAll(options);
386+
// Only overlay non-null per-call options so a null value (set by the
387+
// positional snapshot() overloads for unset params) does not clobber a
388+
// real value coming from .percy.yml config.
389+
for (Map.Entry<String, Object> entry : options.entrySet()) {
390+
if (entry.getValue() != null) {
391+
mergedOptions.put(entry.getKey(), entry.getValue());
392+
}
393+
}
387394
}
388395

389396
try {

0 commit comments

Comments
 (0)