diff --git a/model/Model.cpp b/model/Model.cpp index 4bcf47f..17be4d4 100644 --- a/model/Model.cpp +++ b/model/Model.cpp @@ -235,7 +235,7 @@ namespace glabels /// Distance Model::w() const { - if ( auto* frame = mTmplate.frames().constFirst() ) + if ( auto* frame = !mTmplate.frames().isEmpty() ? mTmplate.frames().constFirst() : nullptr ) { return mRotate ? frame->h() : frame->w(); } @@ -251,7 +251,7 @@ namespace glabels /// Distance Model::h() const { - if ( auto* frame = mTmplate.frames().constFirst() ) + if ( auto* frame = !mTmplate.frames().isEmpty() ? mTmplate.frames().constFirst() : nullptr ) { return mRotate ? frame->w() : frame->h(); }