Added check for falsey adapter in registerAdapter

This commit is contained in:
Ben Ashton 2021-03-02 21:53:46 -08:00
parent cd700f94ab
commit d97c12cd3f

View File

@ -21,6 +21,10 @@ export default {
return adapter.delete(dbName); return adapter.delete(dbName);
}, },
registerAdapter: function(adapter) { registerAdapter: function(adapter) {
if (!adapter) {
throw new PawSQLiteError("Invalid adapter");
}
const wrapped = wrapAdapter(adapter); const wrapped = wrapAdapter(adapter);
if (getAdapter(wrapped.name, true)) { if (getAdapter(wrapped.name, true)) {