fix filter index to use parent child prefix from schema if prefix size is not specified

This commit is contained in:
seroquel 2021-10-08 09:34:01 -07:00
parent 37d3791f15
commit 4d6043d8b3
10 changed files with 10 additions and 5 deletions

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -187,11 +187,10 @@ namespace cloud.insecurity.docker.ipam
try
{
var test = Db.GetCollection("Scopes").FindAll();
newScope = Db.GetCollection<Scope>("Scopes")
.Find(s => s.Id == GetUniqueId(scope.network, scope.prefix)).First();
newScope = Db.GetCollection<Scope>("Scopes")
.Find(s => s.Id == GetUniqueId(scope.network, (scope.prefix != 0)
? scope.prefix
: (int)parent.Schema.child_prefix)).SingleOrDefault();
}
catch(Exception ex)
{