File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ QgsMimeDataUtils::Uri::Uri( QString& encData )
4646 QChar escape = ' \\ ' ;
4747 QString part;
4848 bool inEscape = false ;
49+ if ( encData.isEmpty () )
50+ return ;
4951 for ( int i = 0 ; i < encData.length (); ++i )
5052 {
5153 if ( encData.at ( i ) == escape && !inEscape )
@@ -70,17 +72,17 @@ QgsMimeDataUtils::Uri::Uri( QString& encData )
7072
7173 if ( parts.size () <= 5 ) // PostGISTRaster layers yields five parts
7274 {
73- layerType = parts[ 0 ] ;
74- providerKey = parts[ 1 ] ;
75- name = parts[ 2 ] ;
75+ layerType = parts. value ( 0 ) ;
76+ providerKey = parts. value ( 1 ) ;
77+ name = parts. value ( 2 ) ;
7678 // fetchs PostGISRaster layers
77- if ( parts[ 3 ] == " PG" )
79+ if ( parts. value ( 3 ) == " PG" )
7880 {
79- uri = parts[ 3 ] + " :" + parts[ 4 ] ;
81+ uri = parts. value ( 3 ) + " :" + parts. value ( 4 ) ;
8082 }
8183 else
8284 {
83- uri = parts[ 3 ] ;
85+ uri = parts. value ( 3 ) ;
8486 }
8587 QgsDebugMsg ( " type: " + layerType + " key: " + providerKey + " name: " + name + " uri: " + uri );
8688 }
You can’t perform that action at this time.
0 commit comments