Skip to content

Commit

Permalink
Merge pull request #1212 from Autodesk/fowlert/MAYA-109952/nullptr_check
Browse files Browse the repository at this point in the history
null and anonymous layer checks
  • Loading branch information
Krystian Ligenza authored Feb 26, 2021
2 parents 1317986 + bb01434 commit 02fdccd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/mayaUsd/nodes/layerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,9 @@ bool LayerDatabase::saveUsdToUsdFiles()

SdfLayerHandleVector allLayers = stage->GetLayerStack(false);
for (auto layer : allLayers) {
layer->Save();
if (layer->PermissionToSave()) {
layer->Save();
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mayaUsd/utils/utilSerialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ SdfLayerRefPtr UsdMayaSerialization::saveAnonymousLayer(

SdfLayerRefPtr newLayer = SdfLayer::FindOrOpen(path);

if (parentLayer) {
if (newLayer && parentLayer) {
parentLayer->GetSubLayerPaths().Replace(
anonLayer->GetIdentifier(), newLayer->GetIdentifier());
}
Expand Down

0 comments on commit 02fdccd

Please sign in to comment.