Aberdeen grabbed their third 1-0 victory in a row, but they had to work extremely hard to get past St Mirren.
It was indeed a mistake from St Mirren that led to the winning goal.
Defender Will Haining lost his footing when trying to play the ball upfield and Darren Mackie pounced, before racing forward and passing to Lee Miller.
His shot was blocked by Potter, but the ball broke kindly to Mackie and he rammed home from 12 yards.
On 13 minutes, the visitors had keeper Jamie Langfield to thank when he produced a great double save, pushing away a thundering left-foot shot from Franco Miranda and then foiling Billy Mehmet, who looked set to score, Langfield diving to his left to beat out the striker's close-range shot.
The keeper again was called into action, saving a Gary Mason shot after Mehmet set him up and then on 31 minutes, Mehmet missed a glorious chance, when he blasted over from eight yards after good pressure from St Mirren.
A great free-kick from Miranda, at the start of the second-half, searched out the unmarked Mehmet, but he failed to get a good touch and the ball sailed wide.
On 50 minutes, a quick free-kick for St Mirren, from Mason, released Andy Dorman and he outpaced Charlie Mulgrew before advancing into the box. He cleverly clipped the ball over the advancing Langfield, but Andy Considine brilliantly headed off the line.
Eight minutes later, Mackie tried to double the Dons lead when he outjumped Jack Ross, only to see Mark Howard get his hands to the ball and keep it out.
Just after the hour Gary McDonald tried his luck for Aberdeen, his shot being deflected by John Potter and going just wide of the post.
On 67 minutes, St Mirren's Dorman found himself in acres of space just outside the box, but his effort was weak and barely troubled Langfield.
Controversy raged on 73 minutes when Lee Miller went down under a challenge from Potter, but referee Mr Collum booked Miller for diving and awarded Saints a free-kick.