Skip to content

Commit 524e142

Browse files
committedMay 7, 2013
[Fix #7772] Check attribute index before setting attribute to avoid crash
1 parent c5142da commit 524e142

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed
 

‎src/core/qgsfeature.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,11 @@ void QgsFeature::initAttributes( int fieldCount )
184184

185185
bool QgsFeature::setAttribute( int idx, const QVariant &value )
186186
{
187-
#ifdef QGISDEBUG
188187
if ( idx < 0 || idx >= mAttributes.size() )
189188
{
190189
QgsMessageLog::logMessage( QObject::tr( "Attribute index %1 out of bounds [0;%2[" ).arg( idx ).arg( mAttributes.size() ), QString::null, QgsMessageLog::WARNING );
191190
return false;
192191
}
193-
#endif
194192

195193
mAttributes[idx] = value;
196194
return true;

0 commit comments

Comments
 (0)
Please sign in to comment.