Skip to content
Snippets Groups Projects
Commit 3d9a7192 authored by Haelwenn's avatar Haelwenn
Browse files

normalizers: Fix crash in parseTuples when tuples is empty

parent fd76c114
No related branches found
No related tags found
2 merge requests!326Mergeback: 2.5.0,!282Release/2.5.0
......@@ -14,6 +14,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [2.5.0] - 2022-??-??
### Fixed
- Crash when parsing tuples in Settings
## [2.4.0] - 2021-08-01
### Added
......
......@@ -56,6 +56,10 @@ export const parseNonTuples = (key, value) => {
}
// REFACTOR
export const parseTuples = (tuples, key) => {
if (!tuples.reduce) {
console.warn('Got empty tuples with key:', key)
return null
}
return tuples.reduce((accum, item) => {
if (key === ':rate_limit' ||
(key === 'Pleroma.Web.Endpoint.MetricsExporter' && item.tuple[0] === ':auth')) {
......
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