node-keytar
node-keytar copied to clipboard
Ensure secret exists when tyring to read as text
Requirements for Contributing a Bug Fix
- Fill out the template below. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
- The pull request must only fix an existing bug. To contribute other changes, you must use a different template. You can see all templates at https://github.com/atom/.github/tree/master/.github/PULL_REQUEST_TEMPLATE.
- The pull request must update the test suite to demonstrate the changed functionality. For guidance, please see https://flight-manual.atom.io/hacking-atom/sections/writing-specs/.
- After you create the pull request, all status checks must be pass before a maintainer reviews your contribution. For more details, please see https://github.com/atom/.github/tree/master/CONTRIBUTING.md#pull-requests.
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.