Make sure a widget is initialized when creating a widget wrapper
Fix #10357