Skip to content
Snippets Groups Projects
Commit 5d8227df authored by vkovtun's avatar vkovtun
Browse files

BIS-1050: Added a few missing null checks. Enabled the property...

BIS-1050: Added a few missing null checks. Enabled the property "file-server.repository-path" in plugin.properties of ELN-LIMS.
parent 22d81df8
No related branches found
No related tags found
No related merge requests found
......@@ -117,8 +117,8 @@ public abstract class AbstractXLSEntityExportHelper<ENTITY extends IPermIdHolder
propertyTypes.stream().map(getPropertiesMappingFunction(textFormatting, getMergedProperties(entity), warnings))
).toArray(PropertyValue[]::new);
Arrays.stream(entityValues).filter(Objects::nonNull)
.forEach(propertyValue -> miscellaneousFiles.putAll(propertyValue.getMiscellaneousFiles()));
Arrays.stream(entityValues).filter(Objects::nonNull).map(PropertyValue::getMiscellaneousFiles).filter(Objects::nonNull)
.forEach(miscellaneousFiles::putAll);
final String[] stringValues = Arrays.stream(entityValues)
.map(propertyValue -> propertyValue != null ? propertyValue.getValue() : null)
.collect(Collectors.toList()).toArray(String[]::new);
......
......@@ -204,6 +204,11 @@ public abstract class AbstractXLSExportHelper<ENTITY_TYPE extends IEntityType> i
public static Map<String, byte[]> findImageFiles(final String input, final Collection<String> warnings)
{
if (input == null)
{
return null;
}
// Regular expression to match <img src='/openbis/openbis/file-service/...' or <img src="/openbis/openbis/file-service/..."
final String regex = "<img\\s+src=[\"'](/openbis/openbis/file-service/[^\"']*)[\"']";
final Pattern pattern = Pattern.compile(regex);
......
......@@ -5,7 +5,7 @@ file-server.maximum-file-size-in-MB = 10
#
# The absolute or relative path to the location in the file system where the files are stored.
# Default value: ../../../data/file-server
# file-server.repository-path = ../../../data/file-server
file-server.repository-path = ../../../data/file-server
file-server.section_eln-lims.download-url-template = { "url": "${download-url-file-server}" }
file-server.section_eln-lims.error-message-template = { "error": { "message": "${error-message}" } }
1
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment