Handling null source

18 views
Skip to first unread message

Gin

unread,
Apr 23, 2018, 2:44:31 PM4/23/18
to modelmapper
Hi,

Is it possible to configure the modelMapper to handle a null source by simply returning null, e.g.

modelMapper.map(null, SomeClass.class)

would return null.

Thanks,
Gintas

Chun Han Hsiao

unread,
Apr 25, 2018, 8:18:22 AM4/25/18
to model...@googlegroups.com
Hi Gintas,

Currently, ModelMapper can't handle for null source value. I prefer to check the source is null before we call.

Regards,
Chun Han

Gin <gintauta...@gmail.com> 於 2018年4月24日 週二 上午2:44寫道:
--
You received this message because you are subscribed to the Google Groups "modelmapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modelmapper...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages