Skip to content

Commit

Permalink
fix bug #522: "CADTools - Drawing Blocks throws NPEs"
Browse files Browse the repository at this point in the history
don't NPE if drawing featureDrawingUtil.createAddCommand() returns null
  • Loading branch information
edeso committed Aug 16, 2022
1 parent eff7c34 commit cb8857f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import com.vividsolutions.jump.I18N;
import com.vividsolutions.jump.workbench.JUMPWorkbench;
import com.vividsolutions.jump.workbench.model.UndoableCommand;

import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
Expand Down Expand Up @@ -85,9 +86,13 @@ protected void gestureFinished() throws Exception {
GeometryUtils.scaleGeometry(geom2, dimension);
GeometryUtils.centerGeometry(geom2, displacement);

execute(featureDrawingUtil.createAddCommand(geom2,
isRollingBackInvalidEdits(), getPanel(), this));
// TODO: [202208 ed] lots a symbols seem to not pass geom.isValid() anymore
// disabled the check, but am not sure this is the proper solution
UndoableCommand cmd = featureDrawingUtil.createAddCommand(geom2,
/*isRollingBackInvalidEdits()*/false, getPanel(), this);

if (cmd!=null)
execute(cmd);
}

@Override
Expand Down

0 comments on commit cb8857f

Please sign in to comment.