ALL methods which have a return-type other than "void" need to return SOMETHING for every possible scenario.
Example:
public int wtf(int blah)
{
if (blah == 3)
{
return 3;
}
}
The above would yield and error because not all possible scenarios of the member return a value.
What happens when blah IS NOT 3?
Nothing. Nothing? That's exactly the problem.
public int wtf(int blah)
{
if (blah == 3)
{
return 3;
}
return 0;
}
would compile correctly.
Now, your solution lies in adding an "Else" switch to your first If-Statement in your while loop. Return a default value there, or even null if you want and all should be fine.