Error CS0161 : not all code paths return a value?

I came up with this error and I searched alot about this error and tryied diferent code options but I wasn’t able to find my way arround it so here I am asking for your help.

Heres the code:

	public string ReturnItemName (int index) {

		for (int i = 0; i<ItemList.Length; i++) {

			if (ItemList*.Id == index) {*

_ return ItemList*.Name;*_

* }*

* }*

* }*
Thanks in advance!

What happens when if(condition) is false? There’s no “return;”

You need to restructure this to always return something