I have personally never used
SetParent(). I have always used the
parent property, like so:
Bricks.transform.parent = BrickHolder;
This should be pretty much equivalent though, so I don't expect that is the issue (confirmed in comments already). The difference is that
SetParent() allows you to update the child transform in relation to the parent, or not (with the second boolean parameter:
null, Unity will happily accept it without error, since it's valid to unparent a child object. Make sure that
BrickHolder has been assigned.
Bricks is also
null, that would suggest that
brick is not valid (probably also
null). You will need to make sure both
Brickholder have been assigned to your component in the inspector or through another script.
The only other suggestion I can offer is that sometimes you need to reset your component (the one in your question) in the inspector or remove and reattach. Sometimes Unity doesn't update the serialized values if it thinks they haven't changed, so may be referencing invalid objects.