summaryrefslogtreecommitdiff
path: root/libs/ardour/region_factory.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/region_factory.cc')
-rw-r--r--libs/ardour/region_factory.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc
index 84d8167240..88925a7f16 100644
--- a/libs/ardour/region_factory.cc
+++ b/libs/ardour/region_factory.cc
@@ -72,7 +72,7 @@ RegionFactory::create (boost::shared_ptr<const Region> region)
{
boost::shared_ptr<const AudioRegion> ar;
boost::shared_ptr<const MidiRegion> mr;
-
+
if ((ar = boost::dynamic_pointer_cast<const AudioRegion>(region)) != 0) {
boost::shared_ptr<Region> ret (new AudioRegion (ar));
/* pure copy constructor - no CheckNewRegion emitted */
@@ -101,7 +101,11 @@ boost::shared_ptr<Region>
RegionFactory::create (Session& session, XMLNode& node, bool yn)
{
boost::shared_ptr<Region> r = session.XMLRegionFactory (node, yn);
- CheckNewRegion (r);
+
+ if (r) {
+ CheckNewRegion (r);
+ }
+
return r;
}