Skip to content

Commit 57700b3

Browse files
authored
BE-5866 - Handle the case of the null security score data in the sync down response (#72)
* Handle the case where the null security score data in the sync down response * Check if the data field is an empty uint array and pass the string record uid to the storage.delete function * v.16.0.73
1 parent 92eb197 commit 57700b3

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

keeperapi/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

keeperapi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@keeper-security/keeperapi",
33
"description": "Keeper API Javascript SDK",
4-
"version": "16.0.72",
4+
"version": "16.0.73",
55
"browser": "dist/index.es.js",
66
"main": "dist/index.cjs.js",
77
"types": "dist/node/index.d.ts",

keeperapi/src/vault.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,11 +912,16 @@ const processSecurityScoreData = async (securityScoreDataList: Vault.ISecuritySc
912912
for (const securityScoreData of securityScoreDataList) {
913913
if (
914914
!securityScoreData.recordUid
915-
|| !securityScoreData.data
916915
|| typeof securityScoreData.revision !== 'number'
917916
) continue
918917

919918
const recUid = webSafe64FromBytes(securityScoreData.recordUid)
919+
920+
if (!securityScoreData.data || securityScoreData.data.length === 0) {
921+
await storage.delete('security_score_data', recUid)
922+
continue
923+
}
924+
920925
try {
921926
const decrypted = await platform.decrypt(securityScoreData.data, recUid, 'gcm', storage)
922927
const securityScoreDataObj = JSON.parse(platform.bytesToString(decrypted))

0 commit comments

Comments
 (0)