In either case provided for in Sections 19-124 and 19-125 of this Act, if the case is tried by a jury, the damages may be assessed by such jury, but if the plaintiff takes a voluntary dismissal or an involuntary dismissal is ordered by the court or judgment is entered for defendant without a trial, the damages may be assessed by the court or by a jury impaneled for that purpose.
735 ILCS 5/19-126