Multiply both sides by x to clear the denominator, then divide by m.
mx=y,x=my
The last step needs m=0, and x=0 is excluded either way, since it would make the original denominator zero.
The exactly-one-solution assumption also requires y=0: with m=0, setting y=0 would give only the excluded candidate x=0. Thus x=my is nonzero and is allowed in the original equation.