Skip to content

Commit 165b183

Browse files
voxeliterator now checks if the passed map has elements (#3405)
1 parent f136969 commit 165b183

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

app/assets/javascripts/oxalis/model/volumetracing/volumelayer.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,15 @@ export class VoxelIterator {
5252
this.minCoord2d = minCoord2d;
5353
this.get3DCoordinate = get3DCoordinate;
5454
this.boundingBox = boundingBox;
55-
const firstCoordinate = this.get3DCoordinate(this.minCoord2d);
56-
if (this.map[0][0] && this.isCoordinateInBounds(firstCoordinate)) {
57-
this.next = firstCoordinate;
55+
if (!this.map || !this.map[0]) {
56+
this.hasNext = false;
5857
} else {
59-
this.getNext();
58+
const firstCoordinate = this.get3DCoordinate(this.minCoord2d);
59+
if (this.map[0][0] && this.isCoordinateInBounds(firstCoordinate)) {
60+
this.next = firstCoordinate;
61+
} else {
62+
this.getNext();
63+
}
6064
}
6165
}
6266

0 commit comments

Comments
 (0)