Skip to content

Commit

Permalink
postgres providers: null values in array don't need curly braces
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 31, 2017
1 parent 7bc3bfd commit b52b577
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -3997,7 +3997,8 @@ QString QgsPostgresProvider::description() const

static void jumpSpace( const QString& txt, int& i )
{
while ( i < txt.length() && txt.at( i ).isSpace() ) ++i;
while ( i < txt.length() && txt.at( i ).isSpace() )
++i;
}

static QString getNextString( const QString& txt, int& i, const QString& sep )
Expand Down Expand Up @@ -4092,7 +4093,8 @@ static QVariant parseArray( const QString& txt, QVariant::Type type, QVariant::T
{
if ( !txt.startsWith( '{' ) || !txt.endsWith( '}' ) )
{
QgsLogger::warning( "Error parsing array, missing curly braces: " + txt );
if( !txt.isEmpty() )
QgsLogger::warning( "Error parsing array, missing curly braces: " + txt );
return QVariant( type );
}
QString inner = txt.mid( 1, txt.length() - 2 );
Expand Down

0 comments on commit b52b577

Please sign in to comment.