do not throw exceptions for null layers
extracted _createControlAndCallHooks common method