From a489d9c72f007b3f6e66d2c91d7895a200621410 Mon Sep 17 00:00:00 2001 From: Chau Tran Date: Thu, 4 Mar 2021 10:35:56 -0600 Subject: [PATCH] fix(core): null check for source selector on MapFrom --- .../src/lib/create-mapper/create-map-for-member.util.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/core/src/lib/create-mapper/create-map-for-member.util.ts b/packages/core/src/lib/create-mapper/create-map-for-member.util.ts index b6e470418..a61202a08 100644 --- a/packages/core/src/lib/create-mapper/create-map-for-member.util.ts +++ b/packages/core/src/lib/create-mapper/create-map-for-member.util.ts @@ -55,10 +55,11 @@ export function createMapForMember< // if the transformation is MapFrom or MapWith, we have information on the source value selector if ( - mapMemberFn[MapFnClassId.type] === TransformationType.MapFrom || - mapMemberFn[MapFnClassId.type] === TransformationType.MapWith + (mapMemberFn[MapFnClassId.type] === TransformationType.MapFrom || + mapMemberFn[MapFnClassId.type] === TransformationType.MapWith) && + mapMemberFn[MapFnClassId.misc] != null ) { - sourcePath = getMemberPath(mapMemberFn[MapFnClassId.misc]!); + sourcePath = getMemberPath(mapMemberFn[MapFnClassId.misc]); } // initialize MappingProperty