Skip to content

Commit 13b9bb3

Browse files
fix: add type and check result state before using it
Co-authored-by: pjt <26487010+PierreJeanjacquot@users.noreply.github.com>
1 parent a00c580 commit 13b9bb3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/format.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ export const multiaddrHexToHuman = (hexString: string): string => {
1212
return res;
1313
};
1414

15-
export const taskResultToObject = (results) => {
15+
export const taskResultToObject = (results?: string | null) => {
1616
let resultObj = { storage: 'none' };
1717
try {
18-
if (results !== '0x') {
18+
if (results && results !== '0x') {
1919
resultObj = JSON.parse(
2020
Buffer.from(results.substr(2), 'hex').toString('utf8')
2121
);

0 commit comments

Comments
 (0)