Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lnsane committed Sep 14, 2020
1 parent 504e6e1 commit bc5d4b9
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -4,6 +4,7 @@
import freemarker.template.TemplateModelException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.domain.Example;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand Down Expand Up @@ -87,7 +88,10 @@ public ThemeSetting save(String key, String value, String themeId) {
log.debug("Creating theme setting: [{}]", setting);
return setting;
});

// Determine whether the data already exists
if (themeSettingRepository.findOne(Example.of(themeSetting)).isPresent()) {
return null;
}
// Save the theme setting
return themeSettingRepository.save(themeSetting);
}
Expand Down

0 comments on commit bc5d4b9

Please sign in to comment.