Skip to content

Commit 6210636

Browse files
author
homann
committed
Removed crashed when reading VERY early project files
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11430 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 3d3c72f commit 6210636

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/core/qgsprojectversion.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,19 @@ QgsProjectVersion::QgsProjectVersion( QString string )
3535

3636
QStringList fileVersionParts = pre.section( "-", 0 ).split( "." );
3737

38+
mMinor = 0;
39+
mSub = 0;
40+
mName = "";
3841
mMajor = fileVersionParts.at( 0 ).toInt();
39-
mMinor = fileVersionParts.at( 1 ).toInt();
40-
mSub = fileVersionParts.at( 2 ).toInt();
42+
43+
if ( fileVersionParts.size() > 1 )
44+
{
45+
mMinor = fileVersionParts.at( 1 ).toInt();
46+
}
47+
if ( fileVersionParts.size() > 2 )
48+
{
49+
mSub = fileVersionParts.at( 2 ).toInt();
50+
}
4151
mName = string.section( '-', 1 );
4252

4353
QgsDebugMsg( QString( "Version is set to " ) + text() );

0 commit comments

Comments
 (0)