File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -211,13 +211,13 @@ export class TransformOperationExecutor {
211
211
if ( ! ( value [ valueKey ] instanceof Array ) ) {
212
212
if ( this . transformationType === TransformationType . PLAIN_TO_CLASS ) {
213
213
type = metadata . options . discriminator . subTypes . find ( subType => {
214
- if ( subValue && metadata . options . discriminator . property in subValue ) {
214
+ if ( subValue && subValue instanceof Object && metadata . options . discriminator . property in subValue ) {
215
215
return subType . name === subValue [ metadata . options . discriminator . property ] ;
216
216
}
217
217
} ) ;
218
218
type === undefined ? ( type = newType ) : ( type = type . value ) ;
219
219
if ( ! metadata . options . keepDiscriminatorProperty ) {
220
- if ( subValue && metadata . options . discriminator . property in subValue ) {
220
+ if ( subValue && subValue instanceof Object && metadata . options . discriminator . property in subValue ) {
221
221
delete subValue [ metadata . options . discriminator . property ] ;
222
222
}
223
223
}
You can’t perform that action at this time.
0 commit comments