Add null check to offset
@@ -43,6 +43,7 @@ public class FileBasedTemplateHandler implements ReadOnlyTemplateHandler {
private static final Log log = LogFactory.getLog(FileBasedTemplateHandler.class);
private static final Integer DEFAULT_SEARCH_LIMIT = 100;
+ private static final Integer DEFAULT_SEARCH_OFFSET = 0;
@Override
public Template getTemplateById(String templateId) throws TemplateManagementException {
@@ -63,6 +64,10 @@ public class FileBasedTemplateHandler implements ReadOnlyTemplateHandler {
}
}
+ if (offset == null) {
+ offset = DEFAULT_SEARCH_OFFSET;
+ }
+
return TemplateManagerDataHolder.getInstance().getFileBasedTemplates().entrySet().stream()
.filter(entry -> StringUtils.equals(entry.getValue().getTemplateType().toString(), (templateType)))
.skip(offset)
