Skip to content

Commit

Permalink
Replace Some(null) with None
Browse files Browse the repository at this point in the history
  • Loading branch information
goshaQ committed Jun 24, 2020
1 parent cc304aa commit c892a56
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object CountryHelpers {
val constructorArgs = constructor.paramLists.flatten.map( (param: Symbol) => {
val paramName = param.name.toString
if(param.typeSignature <:< typeOf[Option[Any]])
m.get(paramName)
m.get(paramName).flatMap(Option(_))
else
m.getOrElse(paramName, throw new IllegalArgumentException("Map is missing required parameter named " + paramName))
})
Expand Down

0 comments on commit c892a56

Please sign in to comment.