From 0f1163c722a39783b07ca6d4027010cb310e7b36 Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Tue, 10 Jan 2012 13:54:31 +0000 Subject: Don't allow null form fields diff --git a/Swiften/Elements/Form.h b/Swiften/Elements/Form.h index 47ff7d4..0d1ed63 100644 --- a/Swiften/Elements/Form.h +++ b/Swiften/Elements/Form.h @@ -28,7 +28,10 @@ namespace Swift { public: Form(Type type = FormType) : type_(type) {} - void addField(boost::shared_ptr field) { fields_.push_back(field); } + /** Add a field to the form. + * @param field New field - must not be null. + */ + void addField(boost::shared_ptr field) {assert(field); fields_.push_back(field); } const std::vector >& getFields() const { return fields_; } void setTitle(const std::string& title) { title_ = title; } const std::string& getTitle() const { return title_; } -- cgit v0.10.2-6-g49f6