Skip to content

Commit

Permalink
fix(core): null check mapping before applying typeConverters
Browse files Browse the repository at this point in the history
  • Loading branch information
Chau Tran authored and Chau Tran committed Aug 2, 2021
1 parent 83fd239 commit 5d87147
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/lib/create-mapper/create-mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export function createMapper<TKey = unknown>({
const mapping = plugin.initializeMapping(source, destination, options);

// apply typeConverters
applyTypeConverters(mapping, typeConverters);
if (mapping) {
applyTypeConverters(mapping, typeConverters);
}

// return the FluentFunction for chaining
return createMapFluentFunction(mapping!);
Expand Down

0 comments on commit 5d87147

Please sign in to comment.