THE Crown Office is to review anti-stalking legislation for any "gaps" after the ex-lover of best-selling author Janice Galloway walked free from court.

Concert pianist Graeme McNaught faced five charges of acting in a threatening and abusive manner and placing Ms Galloway, author of novels such as The Trick is to Keep Breathing and Foreign Parts, in a state of fear and alarm.

The 54-year-old Royal ­Conservatoire of Scotland lecturer was declared unfit to stand trial.

However, after an examination of the facts at Hamilton Sheriff Court, Sheriff Ray Small found he had acted in a threatening and abusive manner towards her.

Last night a Crown Office spokesman said: "We note the sheriff's decision to make no further order. Crown Counsel are carefully considering the sheriff's judgement. This was a complex case which raised a number of novel issues.

"The COPFS [Crown Office Procurator Fiscal Service] national stalking lead and other officials will review the issues which arose, including consideration as to whether there are legislative gaps in this area."

The court heard how three reports following a medical examination of Mr McNaught by a doctor and a psychiatrist showed there was "no need" for a supervision and treatment order, he said.

Sheriff Small said there was, however, "the understanding" that he keep in contact with the mental health group he was attending "on a voluntary basis for support" and that if they notice a change in his mental health "they can take action themselves".

Concerns over Mr McNaught's mental health had seen the trial originally halted.

A matter of hours after the case had finished, Mr McNaught had turned up at Ms Galloway's home near Uddingston "to see if we can be friends". Police were alerted but they said last night: "No crime has been established."

Mr McNaught admitted afterwards that he "had to be clever" and "sign up for mental health problems I don't have and just wait till it passed".

He said:"To be quite honest it has been a magic trick on my part, because I did it for the court, I did it to get through this process," he said. "I signed up willingly for the treatment, even took terrible pills they don't work. (They are) meant to control mood levels."

The author, 58, of Uddingston, South Lanarkshire, broke down in tears in court as she said she feared being a victim of 'revenge porn' after Mr McNaught said in an email he had naked photos of her pregnant and planned to show them at an art exhibition.

Ann Moulds, of Action Scotland Against Stalking, who fought a long campaign to have stalking successfully recognised as a crime, said mental health issues should not be used as a defence and was shocked any help for Mr McNaught was on a voluntary basis.

It is estimated police investigated more than 1,000 cases of stalking in the first three years since new stalking laws came into force in 2010, championed by Ms Moulds, who was named public campaigner of the year at The Herald Scottish Politician of the Year Awards in 2010.

She said: "This was a miscarriage of justice and what appears to be a complete lack of understanding about this crime by the sheriff.

"This is a tragic case that should never have been allowed to happen. Underlying mental health or not knowing should not be a defence in this legislation, otherwise every stalker would get off. It is not normal behaviour to engage in stalking behaviour.

"So whether it is unhealthy obsessions, personality disorder, or some other underlying mental health disorder, you would have most of the stalkers walking free if that was considered. This is not justice.

"Why are victims going to come forward and report crimes if this is going to happen?"

Scottish Parliament justice covener Christine Grahame said that wider reform on legislation may be needed to tighten up the law on stalking.

She suggested the problem may not relate to the legislation passed by Holyrood but broader issues around court psychiatric reports recommending no action in spite of offences being proven.