Fix issue with casting UUIDs in MongoDB backing (#443)

This commit is contained in:
Luck 2017-08-18 10:35:56 +02:00
parent 76b203ad10
commit 188d62c99b
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -271,7 +271,7 @@ public class MongoDBBacking extends AbstractBacking {
while (cursor.hasNext()) {
Document d = cursor.next();
UUID uuid = UUID.fromString(d.getString("_id"));
UUID uuid = d.get("_id", UUID.class);
Map<String, Boolean> perms = revert((Map<String, Boolean>) d.get("perms"));
Set<NodeModel> nodes = new HashSet<>();
@ -425,7 +425,7 @@ public class MongoDBBacking extends AbstractBacking {
try (MongoCursor<Document> cursor = c.find().iterator()) {
while (cursor.hasNext()) {
Document d = cursor.next();
uuids.add(UUID.fromString(d.getString("_id")));
uuids.add(d.get("_id", UUID.class));
}
}