From 515916da3ddd0e7a7fc1b7c4e6d2e17d3576b803 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 19 May 2009 19:13:39 +0200 Subject: Testing 'dictionary' if it contains a value before using operator[]. T & QMap::operator[]: "If the map contains no item with key key, the function inserts a default-constructed value into the map with key key, and returns a reference to it" How many occurences of 'dictionary["foo"].startsWith("bar")' has that file by the way? --- tools/configure/configureapp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 2c20d51..a879e5d 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1886,14 +1886,14 @@ bool Configure::checkAvailability(const QString &part) else if (part == "SQL_DB2") available = findFile("sqlcli.h") && findFile("sqlcli1.h") && findFile("db2cli.lib"); else if (part == "SQL_SQLITE") - if (dictionary["XQMAKESPEC"].startsWith("symbian")) + if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) available = false; // In Symbian we only support system sqlite option else available = true; // Built in, we have a fork else if (part == "SQL_SQLITE_LIB") { if (dictionary[ "SQL_SQLITE_LIB" ] == "system") { // Symbian has multiple .lib/.dll files we need to find - if (dictionary["XQMAKESPEC"].startsWith("symbian")) { + if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) { available = true; // There is sqlite_symbian plugin which exports the necessary stuff dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3"; } else { -- cgit v0.12