Need help with Error: not all code paths return a value
<p>my method's like this:-</p>

<pre><code>protected string myMethod()
    {

        if (something)
        {
            string img = "A";
            return img;
        }
        else
          if(something else)
           {
              string img = "B";
              return img;
            }

    }
</code></pre>

<p>When I run the code "not all code paths return a value" is displayed..why so ? the method is returning that "string img" then why this error?</p>
