Skip to content

Commit

Permalink
fix(init): ensures RNRandomBytes exists before we dereference 'seed'
Browse files Browse the repository at this point in the history
RNRandomBytes is not provided on my Expo project, so I got an error when the RNRandomBytes was
attempted to be dereferenced to check if it had a seed.
  • Loading branch information
RobertFischer committed Jul 14, 2020
1 parent 6558396 commit 4ce665c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function toBuffer (nativeStr) {
}

function init () {
if (RNRandomBytes.seed) {
if (RNRandomBytes && RNRandomBytes.seed) {
let seedBuffer = toBuffer(RNRandomBytes.seed)
addEntropy(seedBuffer)
} else {
Expand Down

0 comments on commit 4ce665c

Please sign in to comment.