Remove dangerous asserts
If the if condition makes it possible for the widget object to be null, the assert should not check from the widget's objectName, because if the widget is null, that would crash.