diff --git a/draft-api/src/main/scala/no/ndla/draftapi/service/ConverterService.scala b/draft-api/src/main/scala/no/ndla/draftapi/service/ConverterService.scala index 3150ae078..5f7287055 100644 --- a/draft-api/src/main/scala/no/ndla/draftapi/service/ConverterService.scala +++ b/draft-api/src/main/scala/no/ndla/draftapi/service/ConverterService.scala @@ -797,15 +797,14 @@ trait ConverterService { .flatten ) - val updatedDisclaimer = toMergeInto.disclaimer.map { disclaimer => - mergeLanguageFields( - disclaimer, - maybeLang - .traverse(lang => - articleWithNewContent.disclaimer.toSeq.map(d => toDomainDisclaimer(api.DisclaimerDTO(d, lang))) - ) - .flatten - ) + val updatedDisclaimer = articleWithNewContent.disclaimer match { + case None => toMergeInto.disclaimer + case Some(newDisclaimer) => + val updated = mergeLanguageFields( + toMergeInto.disclaimer.getOrElse(Seq.empty), + maybeLang.map(lang => toDomainDisclaimer(api.DisclaimerDTO(newDisclaimer, lang))).toSeq + ) + Option.when(updated.nonEmpty)(updated) } val updatedContents = mergeLanguageFields(