UIBoxLayout: Fix a crash when appended widget is NULL