Commit 570c0fc9 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Add check to prevent substring going beyond string.

parent 4919cac2
Pipeline #43315 passed with stages
in 4 minutes and 18 seconds
......@@ -55,6 +55,10 @@ object DateFacetBuildHelpers {
* @return The facet values used by outermedia.
*/
fun buildFromNormalizedDateRange(date: String): List<String> {
if (date.length <= 3) {
log.error("Normalized date range has less than 4 characters: $date.")
return emptyList()
}
val from = date.substring(0, 4)
val until = if (date.contains("/")) {
val secondPart = date.split("/")[1]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment