Fix critical bug saving files with frame tags without name (fix #1675)

This commit is contained in:
David Capello 2018-03-14 17:03:25 -03:00
parent ade32b3247
commit d36179ae2a
2 changed files with 9 additions and 2 deletions

View File

@ -147,7 +147,10 @@ FileOpROI::FileOpROI(const app::Document* doc,
if (!sliceName.empty())
m_slice = doc->sprite()->slices().getByName(sliceName);
m_frameTag = doc->sprite()->frameTags().getByName(frameTagName);
// Don't allow exporting frame tags with empty names
if (!frameTagName.empty())
m_frameTag = doc->sprite()->frameTags().getByName(frameTagName);
if (m_frameTag) {
if (m_selFrames.empty())
m_selFrames.insert(m_frameTag->fromFrame(), m_frameTag->toFrame());

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2016-2017 David Capello
// Copyright (C) 2016-2018 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
@ -85,6 +85,10 @@ void fill_frames_combobox(const doc::Sprite* sprite, ui::ComboBox* frames, const
frames->setSelectedItemIndex(i);
for (auto tag : sprite->frameTags()) {
// Don't allow to select empty frame tags
if (tag->name().empty())
continue;
i = frames->addItem(new FrameListItem(tag));
if (defFrame == tag->name())
frames->setSelectedItemIndex(i);