summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/tools/qstring.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/qstring.cpp b/src/tools/qstring.cpp
index 7f246fa..210848c 100644
--- a/src/tools/qstring.cpp
+++ b/src/tools/qstring.cpp
@@ -1513,7 +1513,7 @@ QString::QString( QChar ch )
QString::QString( const QString &s ) :
d(s.d)
{
- if (d != shared_null) {
+ if ( d && (d != shared_null) ) {
#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
@@ -1765,7 +1765,7 @@ void QStringData::deleteSelf()
*/
QString &QString::operator=( const QString &s )
{
- if (s.d != shared_null) {
+ if ( s.d && (s.d != shared_null) ) {
#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
s.d->mutex->lock();
#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE