}
TextItem& ChatMessageItem::GetNameItem() const {
+ if (impl_->name_ == nullptr)
+ return static_cast<TextItem&>(FactoryManager::GetInst().GetNullItem());
return *(impl_->name_);
}
TextItem& ChatMessageItem::GetTextItem() const {
+ if (impl_->text_ == nullptr)
+ return static_cast<TextItem&>(FactoryManager::GetInst().GetNullItem());
return *(impl_->text_);
}
ImageItem& ChatMessageItem::GetImageItem() const {
+ if (impl_->image_ == nullptr)
+ return static_cast<ImageItem&>(FactoryManager::GetInst().GetNullItem());
return *(impl_->image_);
}
TimeItem& ChatMessageItem::GetTimeItem() const {
+ if (impl_->time_ == nullptr)
+ return static_cast<TimeItem&>(FactoryManager::GetInst().GetNullItem());
return *(impl_->time_);
}
return NOTI_EX_ERROR_INVALID_PARAMETER;
}
ChatMessageItem* p = static_cast<ChatMessageItem*>(h->Get());
- *name = new Handle(&(p->GetNameItem()));
+ if (p->GetNameItem().GetType() == AbstractItem::NullObject)
+ *name = nullptr;
+ else
+ *name = new Handle(&(p->GetNameItem()));
return NOTI_EX_ERROR_NONE;
}
return NOTI_EX_ERROR_INVALID_PARAMETER;
}
ChatMessageItem* p = static_cast<ChatMessageItem*>(h->Get());
- *text = new Handle(&(p->GetTextItem()));
+ if (p->GetTextItem().GetType() == AbstractItem::NullObject)
+ *text = nullptr;
+ else
+ *text = new Handle(&(p->GetTextItem()));
return NOTI_EX_ERROR_NONE;
}
return NOTI_EX_ERROR_INVALID_PARAMETER;
}
ChatMessageItem* p = static_cast<ChatMessageItem*>(h->Get());
- *image = new Handle(&(p->GetImageItem()));
+ if (p->GetImageItem().GetType() == AbstractItem::NullObject)
+ *image = nullptr;
+ else
+ *image = new Handle(&(p->GetImageItem()));
return NOTI_EX_ERROR_NONE;
}
return NOTI_EX_ERROR_INVALID_PARAMETER;
}
ChatMessageItem* p = static_cast<ChatMessageItem*>(h->Get());
- *time = new Handle(&(p->GetTimeItem()));
+ if (p->GetTimeItem().GetType() == AbstractItem::NullObject)
+ *time = nullptr;
+ else
+ *time = new Handle(&(p->GetTimeItem()));
return NOTI_EX_ERROR_NONE;
}