Skip to content

Commit

Permalink
Fix error where getFilteredList returns undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilianPichler committed Aug 24, 2017
1 parent adc5e8b commit f0d7edb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,14 @@ export function selectQueryProps (query) {
export function getFilteredList (filterName, filters, list, getSourceValue) {
const { sortField, sortOrientation, queries } = selectFilterProps(filterName, filters)
const dateOptions = { day: '2-digit', month: '2-digit', year: 'numeric' }

if (list == null || list.length < 1) {
return []
}

let result = [...list]

if (list !== undefined && queries) {
if (queries) {
for (let query of queries) {
const { value, operator, field, isCaseSensitive, isSet, type } = selectQueryProps(query)
const queryDateString = new Date(value).toLocaleString('de-DE', dateOptions)
Expand Down

0 comments on commit f0d7edb

Please sign in to comment.