git ssb

1+

Dominic / secure-scuttlebutt



Commit a2e6e922f8d9cb98c60e57c51b85a3fc9aad8494

throw immediately when `db.get` called with a non-ref string

Matt McKegg authored on 6/26/2017, 5:16:39 AM
GitHub committed on 6/26/2017, 5:16:39 AM
Parent: c6d8011081748fa1a8ad7ef5100a3f947ef9d112

Files changed

index.jschanged
index.jsView
@@ -88,9 +88,12 @@
8888 return db.keys.get(key, function (err, seq) {
8989 if(err) cb(err)
9090 else cb(null, seq && seq.value)
9191 })
92- else _get(key, cb) //seq
92+ else if(typeof key === 'number')
93+ _get(key, cb) //seq
94+ else
95+ cb(new Error('Invalid key. You must call `get` with with an ssb ref or flume offset'))
9396 }
9497
9598 var add = Validator(db, opts)
9699 db.add = function (msg, cb) {

Built with git-ssb-web