fix segfault in map image exporter

This commit is contained in:
garak 2023-06-23 13:51:52 -04:00
parent c0a46ae054
commit 3f7913b694

View file

@ -98,8 +98,11 @@ void MapImageExporter::saveImage() {
progress.setMaximum(1); progress.setMaximum(1);
progress.setValue(0); progress.setValue(0);
int maxWidth = this->map->getWidth() * 16; Layout *layout = this->map->layout;
int maxHeight = this->map->getHeight() * 16; if (!layout) break;
int maxWidth = layout->getWidth() * 16;
int maxHeight = layout->getHeight() * 16;
if (showBorder) { if (showBorder) {
maxWidth += 2 * STITCH_MODE_BORDER_DISTANCE * 16; maxWidth += 2 * STITCH_MODE_BORDER_DISTANCE * 16;
maxHeight += 2 * STITCH_MODE_BORDER_DISTANCE * 16; maxHeight += 2 * STITCH_MODE_BORDER_DISTANCE * 16;