Fix check of kdtree loading from disk
This commit is contained in:
parent
e2a2c7287c
commit
59bb99e7ee
@ -643,8 +643,8 @@ namespace CosmoTool {
|
|||||||
throw InvalidOnDiskKDTree();
|
throw InvalidOnDiskKDTree();
|
||||||
}
|
}
|
||||||
if (node_on_disk.cell_id > numNodes || node_on_disk.cell_id < 0 ||
|
if (node_on_disk.cell_id > numNodes || node_on_disk.cell_id < 0 ||
|
||||||
node_on_disk.children_node[0] > lastNode || node_on_disk.children_node[0] < -1 ||
|
(node_on_disk.children_node[0] >= 0 && node_on_disk.children_node[0] > lastNode) || node_on_disk.children_node[0] < -1 ||
|
||||||
node_on_disk.children_node[1] > lastNode || node_on_disk.children_node[1] < -1)
|
(node_on_disk.children_node[1] >= 0 && node_on_disk.children_node[1] > lastNode) || node_on_disk.children_node[1] < -1)
|
||||||
{
|
{
|
||||||
delete[] nodes;
|
delete[] nodes;
|
||||||
std::cerr << "Invalid cell id or children node id invalid" << std::endl;
|
std::cerr << "Invalid cell id or children node id invalid" << std::endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user