Answer: the sentence is correct.
Explanation: Dashes, like commas, semicolons, colons, ellipses, and parentheses, indicate more emphasis, an interruption, or an abrupt change of thought. Experienced writers know that these marks are not undifferentiated. Note how dashes subtly change the tone of the following sentences:
You are the friend, the only friend, who offered to help me.
You are the friend—the only friend—who offered to help me.
I pay the bills; she has all the fun.
I pay the bills—she has all the fun.
I wish you would … oh, never mind.
I wish you would—oh, never mind.