Skip to content

Commit

Permalink
Merge pull request #14654 from futurliberta/fix-populated-map
Browse files Browse the repository at this point in the history
Fix problem when deleting an entry on a populated Map
  • Loading branch information
vkarpov15 authored Jun 10, 2024
2 parents c71ba5e + 26ab76a commit 7bc5395
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/types/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class MongooseMap extends Map {
v.$__.wasPopulated = { value: v._id };
return v;
});
} else {
} else if (value != null) {
if (value.$__ == null) {
value = new populated.options[populateModelSymbol](value);
}
Expand Down

0 comments on commit 7bc5395

Please sign in to comment.