# HG changeset patch # User Chris Cannam # Date 1563358808 -3600 # Node ID b43ff1abdc020f0a1eb3ee72141a8c4539f0673c # Parent 3943d0720167556c2b984b3500ff2cf1597a2da8 Fix inability to set layer's model to None diff -r 3943d0720167 -r b43ff1abdc02 layer/LayerFactory.h --- a/layer/LayerFactory.h Mon Jul 15 13:49:57 2019 +0100 +++ b/layer/LayerFactory.h Wed Jul 17 11:20:08 2019 +0100 @@ -104,8 +104,10 @@ bool trySetModel(Layer *layerBase, ModelId modelId) { LayerClass *layer = dynamic_cast(layerBase); if (!layer) return false; - auto model = ModelById::getAs(modelId); - if (!model) return false; + if (!modelId.isNone()) { + auto model = ModelById::getAs(modelId); + if (!model) return false; + } layer->setModel(modelId); return true; }