summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qstringbuilder.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
index 1f13d0da80..b3d47d2250 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/tools/qstringbuilder.h
@@ -230,13 +230,17 @@ template <> struct QConcatenable<QLatin1String>
static int size(const QLatin1String a) { return a.size(); }
static inline void appendTo(const QLatin1String a, QChar *&out)
{
- for (const char *s = a.data(); *s; )
- *out++ = QLatin1Char(*s++);
+ if (a.data()) {
+ for (const char *s = a.data(); *s; )
+ *out++ = QLatin1Char(*s++);
+ }
}
static inline void appendTo(const QLatin1String a, char *&out)
{
- for (const char *s = a.data(); *s; )
- *out++ = *s++;
+ if (a.data()) {
+ for (const char *s = a.data(); *s; )
+ *out++ = *s++;
+ }
}
};