Couple of assertions

This commit is contained in:
2022-11-12 01:38:52 -08:00
parent d81cb5d834
commit 489416a5eb
4 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,7 @@
using namespace Dawn;
UIComponent::UIComponent(UICanvas *canvas) {
assertNotNull(canvas);
this->canvas = canvas;
}
@ -141,7 +142,7 @@ void UIComponent::addChild(UIComponent *child) {
}
void UIComponent::removeChild(UIComponent *child) {
if(child->parent != this) throw "Invalid child";
assertTrue(child->parent != this);
auto it = this->children.begin();
while(it != this->children.end()) {
if(*it == child) {