fix NPE with null sourcemask on move

This commit is contained in:
dordsor21 2021-01-10 17:36:41 +00:00
parent 846443291f
commit 831c6f6854
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

@ -1627,10 +1627,11 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
} else {
allowedRegion = new RegionIntersection(allowedRegions);
}
mask = MaskIntersection.of(getSourceMask(), mask, new RegionMask(allowedRegion)).optimize();
Mask sourceMask = this.getSourceMask();
mask = MaskIntersection.of(sourceMask, mask, new RegionMask(allowedRegion)).optimize();
if (mask != Masks.alwaysTrue()) {
copy.setSourceMask(mask);
if (this.getSourceMask().equals(mask)) {
if (sourceMask != null && sourceMask.equals(mask)) {
setSourceMask(null);
}
}