Skip to content

Commit 02b2a07

Browse files
authored
Merge pull request #1135 from RedisInsight/fe/bugfix/RI-3510
#RI-3510 - fix pickle formatter
2 parents e6c75c2 + 7829471 commit 02b2a07

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

redisinsight/ui/src/pages/browser/components/hash-details/HashDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ const HashDetails = (props: Props) => {
377377
content={tooltipContent}
378378
anchorClassName="truncateText"
379379
>
380-
<>{formattedValue.substring?.(0, 200) ?? formattedValue}</>
380+
<>{formattedValue?.substring?.(0, 200) ?? formattedValue}</>
381381
</EuiToolTip>
382382
)}
383383
{expanded && formattedValue}

redisinsight/ui/src/utils/formatters/valueFormatters.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { decode, encode } from '@msgpack/msgpack'
22
// eslint-disable-next-line import/order
33
import { Buffer } from 'buffer'
4+
import { isUndefined } from 'lodash'
45
import { serialize, unserialize } from 'php-serialize'
56
import { getData } from 'rawproto'
67
import jpickle from 'jpickle'
@@ -108,6 +109,14 @@ const formattingBuffer = (
108109
case KeyValueFormat.Pickle: {
109110
try {
110111
const decoded = jpickle.loads(bufferToUTF8(reply))
112+
113+
if (isUndefined(decoded)) {
114+
return {
115+
value: bufferToUTF8(reply),
116+
isValid: false
117+
}
118+
}
119+
111120
const value = JSON.stringify(decoded)
112121
return JSONViewer({ value, ...props })
113122
} catch (e) {

0 commit comments

Comments
 (0)