Adding null check for component assertion as sometimes component can be null during testing and if not asserted the previous incarnation will throw a NullPointerException