Skip to content

Commit

Permalink
Merge pull request #3471 from kwvanderlinde/bugfix/3254-grid-shape
Browse files Browse the repository at this point in the history
Handle grids without a grid shape
  • Loading branch information
Phergus authored Jul 9, 2022
2 parents a8c4a5c + f28135c commit 7fae5c5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/net/rptools/maptool/model/Grid.java
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,11 @@ public static Grid fromDto(GridDto dto) {
grid.offsetX = dto.getOffsetX();
grid.offsetY = dto.getOffsetY();
grid.size = dto.getSize();
grid.cellShape = Mapper.map(dto.getCellShape());
if (dto.hasCellShape()) {
grid.cellShape = Mapper.map(dto.getCellShape());
} else {
grid.cellShape = null;
}
return grid;
}

Expand All @@ -949,7 +953,9 @@ public GridDto toDto() {
dto.setOffsetX(offsetX);
dto.setOffsetX(offsetY);
dto.setSize(size);
dto.setCellShape(Mapper.map(cellShape));
if (cellShape != null) {
dto.setCellShape(Mapper.map(cellShape));
}
return dto.build();
}

Expand Down

0 comments on commit 7fae5c5

Please sign in to comment.