If $f=B\sin\theta$ then $\dfrac{dr}{d\theta}=B\cos\theta$. Is it true that $B\cos\theta = \cot(\theta r)=\cot(\theta B\sin\theta)$? Notice that as $\theta\to0$ we have $\cot(\theta B\sin\theta)\to\infty$ (unless $B=0$) (here I'm not distinguishing between $+\infty$ and $-\infty$ but rather with the $\infty$ that is approached if you go in either of the two directions), and $B\sin\theta\to 0\ne\infty$.
The question has been altered since I wrote what appears above.
$$
\frac{dr}{d\theta} = r\cot\theta
$$
If the line immediately above this was intended, then I would write
$$
\frac{dr}r = \frac{\cos\theta\,d\theta}{\sin\theta} = \frac{du}u
$$
so
$$
\log_e |r| = \log_e|u| + C = \log_e\sin\theta + C,
$$
and hence
$$
r = B\sin\theta.
$$
This actually leads to $B$ being a nonzero constant, but since we divided by $r$, we must consider separately the case where $r=0$. And checking by substitution shows that $B=0$ also works.
So the solution of the revised question is correct.