[Tex/LaTex] There is no line here to end \makelettertitle error in moderncv


I am using moderncv templates, on cover letter page i wanted to edit the original code so that the Name/mobile/email appears on top right corner,
enter image description here
but the Build process return the error: There's no line here to end. \makelettertitle
Here is the location that error is happening, if i put any character in \recipient{}{} line such as \recipient{'}{} the error would be solved,but the character will be shown in the result,which i don't want it, i searched for similar cases but none of the solutions given helped, is there any solution for it if i don't want to use \recipient ? (I have tried removing it from the code but it didn't work) The code:

\firstname{John} % Your first name
\familyname{Smith} % Your last name
\title{Curriculum Vitae}
\mobile{(+1) 123 456 7890}
\recipient{}{} % Letter recipient
\date{\today} % Letter date
\opening{Dear Sir, Madam,} % Opening greeting
\closing{Sincerely yours,} % Closing phrase
\enclosure[Attached]{curriculum vit\ae{}} % List of enclosed documents
\makelettertitle % Print letter title
I am an engineer



and the content of class file is:

  % if an optional argument is provided, use it to redefine \enclname

Best Answer

The class loads the auxiliary package moderncvheadi.sty, which has


and this means that if \@recipientname is empty, you get the usual error of a lone \\, that is There's no line to end.



which will make the line non empty, as far as \\ is concerned.