Commit 66cd0092 authored by Ludovic Hussonnois's avatar Ludovic Hussonnois

BUG: Mantis-1393: Remove assertion that crash monteverdi.

Some assert( layerStack->GetCurrent()!=NULL ) have been replace because
GetCurrent() of a layerStack can be null if no image is open.

And those functions can be called with keyboard shortcuts.
parent e12c9f58
......@@ -1587,7 +1587,8 @@ ImageViewWidget
//
// Apply dynamics to current layer.
AbstractLayerModel * layer = layerStack->GetCurrent();
assert( layer!=NULL );
if( layer==NULL )
return;
if( layer->inherits( VectorImageModel::staticMetaObject.className() ) )
{
......@@ -1689,7 +1690,8 @@ ImageViewWidget
assert( stackedLayerModel!=NULL );
AbstractLayerModel * layer = stackedLayerModel->GetCurrent();
assert( layer!=NULL );
if( layer==NULL )
return;
if( layer->inherits( VectorImageModel::staticMetaObject.className() ) )
{
......@@ -1778,7 +1780,8 @@ ImageViewWidget
assert( stackedLayerModel!=NULL );
AbstractLayerModel * layer = stackedLayerModel->GetCurrent();
assert( layer!=NULL );
if( layer==NULL )
return;
if( layer->inherits( VectorImageModel::staticMetaObject.className() ) )
{
......@@ -2012,6 +2015,9 @@ ImageViewWidget
StackedLayerModel * stackedLayerModel = m_Renderer->GetLayerStack();
assert( stackedLayerModel!=NULL );
if( !stackedLayerModel->HasCurrent() )
return;
AbstractLayerModel * layer = stackedLayerModel->GetCurrent();
assert( layer!=NULL );
......@@ -2071,7 +2077,8 @@ ImageViewWidget
assert( stackedLayerModel!=NULL );
AbstractLayerModel * layer = stackedLayerModel->GetCurrent();
assert( layer!=NULL );
if( layer==NULL )
return;
if( layer->inherits( VectorImageModel::staticMetaObject.className() ) )
{
......@@ -2283,7 +2290,8 @@ ImageViewWidget
assert( stackedLayerModel!=NULL );
AbstractLayerModel * layer = stackedLayerModel->GetCurrent();
assert( layer!=NULL );
if( layer==NULL )
return;
if( layer->inherits( VectorImageModel::staticMetaObject.className() ) )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment