diff --git a/infer/src/checkers/LithoDomain.ml b/infer/src/checkers/LithoDomain.ml index 6e81c39b1..b7c8a4ec5 100644 --- a/infer/src/checkers/LithoDomain.ml +++ b/infer/src/checkers/LithoDomain.ml @@ -130,9 +130,10 @@ module Created = struct | CreatedLocation.ByCreateMethod _ -> append_one caller_return callee_return acc | CreatedLocation.ByParameter path -> - let caller_path = SubstPathMap.find path map in - Option.value_map (find_opt caller_path caller) ~default:acc ~f:(fun caller_created -> - append caller_return caller_created acc ) + SubstPathMap.find_opt path map + |> Option.value_map ~default:acc ~f:(fun caller_path -> + Option.value_map (find_opt caller_path caller) ~default:acc + ~f:(fun caller_created -> append caller_return caller_created acc) ) in CreatedLocations.fold accum_subst callee_returns acc )