PITTSFIELD, Mass. — A woman has pleaded guilty to setting a fire at a Pittsfield homeless shelter but will avoid jail if she stays out of further legal trouble.

The Berkshire Eagle (http://bit.ly/2uyLO8s ) reports that 23-year-old Amanda Swift pleaded guilty Tuesday to attempted arson of a dwelling house and burning personal property in connection with the fire in a room she had occupied at the Barton’s Crossing shelter in April 2016.

A judge continued Swift’s case without a finding for two years, which means if she remains out of further legal trouble, the charges will be dismissed.

Firefighters responding to the shelter found that the smoke detector had been removed and its wires cut in Swift’s room. The smoke detector and a lighter were found behind a dresser. No injuries were reported.

Information from: The Berkshire (Mass.) Eagle, http://www.berkshireeagle.com