From 74353fef4524e8418acf5dd854ff41d3a06beff0 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 7 Jan 2014 09:34:27 +0100 Subject: only emit pgp keys if they are actually set if doc.keys has not been set doc.keys[pgp] will raise an error. We always upload the key after signup - but this might fail and there is some time in between. Not checking for this condition lead to errors in the couch logs. --- users/app/models/identity.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/users/app/models/identity.rb b/users/app/models/identity.rb index cbb540e..9b97b51 100644 --- a/users/app/models/identity.rb +++ b/users/app/models/identity.rb @@ -24,7 +24,9 @@ class Identity < CouchRest::Model::Base if (doc.type != 'Identity') { return; } - emit(doc.address, doc.keys["pgp"]); + if (typeof doc.keys === "object") { + emit(doc.address, doc.keys["pgp"]); + } } EOJS view :disabled, -- cgit v1.2.3