node-keytar icon indicating copy to clipboard operation
node-keytar copied to clipboard

Ensure secret exists when tyring to read as text

Open jsimonet opened this issue 3 years ago • 0 comments

Requirements for Contributing a Bug Fix

Identify the Bug

https://github.com/atom/node-keytar/issues/477

Description of the Change

Ensure the variable secret is not NULL before passing it to the function secret_value_get_text.

Alternate Designs

An alternate design could be to use a GCancellable object in secret_service_search_sync function call. I tried to use it but failed to understand how to use it.

Possible Drawbacks

This MR should not add a possible drawback.

Verification Process

Test suite still pass (npm run test). Using FindCredentials without unlocking my keystore in my electron app does not crash anymore.

The error I got during my usage was:

  (process:280213): libsecret-CRITICAL **: 16:02:21.069: secret_value_get_text: assertion 'value' failed

Release Notes

Fixed a bug where calling FindCredentials without unlocking the keystore on Linux.

jsimonet avatar Nov 07 '22 15:11 jsimonet