In their 1995 paper [3], Fehlmann and Gardiner posed an extremal problem, which will be called an obstacle problem throughout the present paper, for quadratic differentials on Riemann surfaces. A compact set $E$ in a Riemann surface $S$ of finite type is called an obstacle if each component of $E$ is relatively contractible in $S$ and if $S \backslash E$ is connected. For a given obstacle $E$ and a symmetric integrable quadratic differential $\varphi \neq 0$ on $S$; the obstacle problem is to find a conformal embedding $g$ of $S \backslash E$ into another Riemann surface $R$ of the same type as $S$ and a symmetric quadratic differential $\psi$ on $R$ so that the following three conditions hold: (i) the borders and punctures are preserved under the mapping $g$; (ii) the pull-back $g^{*}\psi$ gives the same heights vector as that of $\varphi$; and (iii) the norm $\| \psi \|_{L^{1}(R)}$ is maximal among those embeddings. Fehlmann and Gardiner asserted existence and uniqueness of a solution to the obstacle problem when $E$ consists only of finitely many components. It seems, however, that the uniqueness assertion is not correct in their form. In the present paper, we extend the existence theorem and give a correction to the uniqueness assertion in the general case. As an application we provide a slit mapping theorem for an open Riemann surface of finite genus.