diff options
-rw-r--r-- | Swiften/Elements/Form.h | 5 |
1 files changed, 4 insertions, 1 deletions
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 @@ -22,19 +22,22 @@ namespace Swift { class Form : public Payload { public: typedef boost::shared_ptr<Form> ref; enum Type { FormType, SubmitType, CancelType, ResultType }; public: Form(Type type = FormType) : type_(type) {} - void addField(boost::shared_ptr<FormField> field) { fields_.push_back(field); } + /** Add a field to the form. + * @param field New field - must not be null. + */ + void addField(boost::shared_ptr<FormField> field) {assert(field); fields_.push_back(field); } const std::vector<boost::shared_ptr<FormField> >& getFields() const { return fields_; } void setTitle(const std::string& title) { title_ = title; } const std::string& getTitle() const { return title_; } void setInstructions(const std::string& instructions) { instructions_ = instructions; } const std::string& getInstructions() const { return instructions_; } Type getType() const { return type_; } void setType(Type type) { type_ = type; } |