From eb4c03004e07691364c551098089b415d7885b92 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Wed, 18 Nov 2020 20:32:36 +0100 Subject: [PATCH] Return undefined instead of null in case of an error --- src/keys.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/keys.js b/src/keys.js index b0de886..6c9c311 100644 --- a/src/keys.js +++ b/src/keys.js @@ -35,7 +35,7 @@ const fetchHKP = async (identifier, keyserverBaseUrl) => { return publicKey } catch (e) { console.error(e) - return null + return undefined } } @@ -50,7 +50,7 @@ const fetchWKD = async (identifier) => { return publicKey } catch (e) { console.error(e) - return null + return undefined } } @@ -66,14 +66,14 @@ const fetchKeybase = async (username, fingerprint) => { }) .then((response) => response.text()) } catch (e) { - return null + return undefined } const publicKey = (await openpgp.key.readArmored(rawKeyContent)).keys[0] return publicKey } catch (e) { console.error(e) - return null + return undefined } } @@ -84,7 +84,7 @@ const fetchPlaintext = async (rawKeyContent) => { return publicKey } catch (e) { console.error(e) - return null + return undefined } } @@ -103,7 +103,7 @@ const fetchSignature = async (rawSignatureContent, keyserverBaseUrl) => { return fetchHKP(sigUserId ? sigUserId : sigKeyId, keyserverBaseUrl) } catch (e) { console.error(e) - return null + return undefined } } @@ -136,7 +136,7 @@ const fetchURI = async (uri) => { } } catch (e) { console.error(e) - return null + return undefined } } @@ -151,7 +151,7 @@ const process = async (publicKey) => { } } catch (e) { console.error(e) - return null + return undefined } } @@ -169,7 +169,7 @@ const getClaims = async (publicKey) => { return notations } catch (e) { console.error(e) - return null + return undefined } } @@ -180,7 +180,7 @@ const getFingerprint = async (publicKey) => { return keyData.fingerprint } catch (e) { console.error(e) - return null + return undefined } }