summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qobject_impl.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/kernel/qobject_impl.h b/src/corelib/kernel/qobject_impl.h
index 9918b1f1c2..d34b81ceaf 100644
--- a/src/corelib/kernel/qobject_impl.h
+++ b/src/corelib/kernel/qobject_impl.h
@@ -96,12 +96,14 @@ namespace QtPrivate {
};
template<typename T, typename U>
void operator,(const T &value, const ApplyReturnValue<U> &container) {
- *reinterpret_cast<U*>(container.data) = value;
+ if (container.data)
+ *reinterpret_cast<U*>(container.data) = value;
}
#ifdef Q_COMPILER_RVALUE_REFS
template<typename T, typename U>
void operator,(T &&value, const ApplyReturnValue<U> &container) {
- *reinterpret_cast<U*>(container.data) = value;
+ if (container.data)
+ *reinterpret_cast<U*>(container.data) = value;
}
#endif
template<typename T>