Fixed empty model being added when loading some MPD files.

This commit is contained in:
leo 2015-03-25 15:33:58 +00:00
parent 5dc511d56a
commit c9839c945e

View file

@ -216,9 +216,15 @@ bool Project::Load(const QString& FileName)
while (!Buffer.atEnd())
{
lcModel* Model = new lcModel(QString());
mModels.Add(Model);
Model->LoadLDraw(Buffer, this);
Model->SetSaved();
if (mModels.IsEmpty() || !Model->GetProperties().mName.isEmpty())
{
mModels.Add(Model);
Model->SetSaved();
}
else
delete Model;
}
}
else