Solution 1 :

Per comments on the question, you are asking about a style recommendation from your IDE, related specifically to:

    if (myRoot == null) return myRoot;

Your IDE means that when that particular return statement is executed, myRoot is always null. It is obvious that this is so, because the if ensures that otherwise, that return is not executed. Your IDE is recommending that you change that to

    if (myRoot == null) return null;

Whether you do so is up to you, but personally, I would go with your IDE’s advice, because it makes the code slightly clearer.

Problem :

The height of my bootstrap cards is extending way too much when I am adding images. Is there any way to keep the cards from not overextending?

Cards without images ~ Perfect

Cards with images ~ Overflowing and covering the next element

Comments

Comment posted by John Bollinger

How about cutting and pasting the actual error message, rather than paraphrasing it. Also, are you certain that it refers to the method you have presented? If so, then which line is it flagging?

Comment posted by John Bollinger

As a matter of style, I strongly recommend always using a block (

Comment posted by minimal reproducible example

@spiritmonster, as far as I can tell, your question is about the message that

By