Is it overkill to RequireComponent then check if GetComponent isnt Null in Awake?

Would it be redundant to check for Nulls in the Awake function() when using GetComponents if the script already has RequireComponent? Seems debatable but is it good or bad practice? Would there be a better way to check for nulls such as using Try and Catch?


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class test : MonoBehaviour {

    private Rigidbody rb;

    void Awake()
        rb = GetComponent<Rigidbody>();
        if (rb == null)
            Debug.Log("Rigidbody cannot be null");

I’m tempted to say this is overkill in this instance (it kinda defeats the point of using RequireComponent if you’re going to test for null anyway). However, in some cases, it might not be…

I’m not sure if it is possible to do this with a component possessing the RequireComponent tag, but I’d imagine a null test would be a good idea if there’s a possibility of the required component being removed from the object at runtime (I think Unity would somehow stop you from doing this, but I’m not completely sure).