diff options
Diffstat (limited to 'Swiften/Elements')
-rw-r--r-- | Swiften/Elements/Message.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Swiften/Elements/Message.h b/Swiften/Elements/Message.h index 3b9145c..ea99814 100644 --- a/Swiften/Elements/Message.h +++ b/Swiften/Elements/Message.h @@ -38,8 +38,10 @@ namespace Swift { updatePayload(boost::make_shared<Subject>(subject)); } + // Explicitly convert to bool. In C++11, it would be cleaner to + // compare to nullptr. bool hasSubject() { - return getPayload<Subject>(); + return static_cast<bool>(getPayload<Subject>()); } std::string getBody() const { |