Don't set asset.id to an empty string.
The `Asset` constructor sets `asset.id` to the asset's path, a sensible default. Of course, if the asset has a name instead of a path, we have to use that instead. Or if the user specified an ID, that's even better. We just don't want to default to `""`, since then a bunch of assets could have the same ID. Resolves #1758.
This commit is contained in:
@@ -676,21 +676,18 @@ class ProjectXMLParser extends HXProject
|
||||
}
|
||||
}
|
||||
|
||||
var id = "";
|
||||
|
||||
var asset = new Asset(path + childPath, targetPath + childTargetPath, childType, childEmbed);
|
||||
asset.library = childLibrary;
|
||||
|
||||
if (childElement.has.id)
|
||||
{
|
||||
id = substitute(childElement.att.id);
|
||||
asset.id = substitute(childElement.att.id);
|
||||
}
|
||||
else if (childElement.has.name)
|
||||
{
|
||||
id = substitute(childElement.att.name);
|
||||
asset.id = substitute(childElement.att.name);
|
||||
}
|
||||
|
||||
var asset = new Asset(path + childPath, targetPath + childTargetPath, childType, childEmbed);
|
||||
asset.library = childLibrary;
|
||||
asset.id = id;
|
||||
|
||||
if (childGlyphs != null)
|
||||
{
|
||||
asset.glyphs = childGlyphs;
|
||||
|
||||
Reference in New Issue
Block a user