Fix an issue causing a user object to be turned into a pad

This commit is contained in:
yflory
2017-01-12 11:09:45 +01:00
parent 51a2cfa141
commit 3f1e287811
2 changed files with 12 additions and 1 deletions

View File

@@ -138,7 +138,10 @@ define([
var init = function (f, Cryptpad) {
if (!Cryptpad || initialized) { return; }
initialized = true;
var hash = Cryptpad.getUserHash() || localStorage.FS_hash;
var hash = Cryptpad.getUserHash() || localStorage.FS_hash || Cryptpad.createRandomHash();
if (!hash) {
throw new Error('[Store.init] Unable to find or create a drive hash. Aborting...');
}
var secret = Cryptpad.getSecrets(hash);
var listmapConfig = {
data: {},