Python Beginner: Trim Circle

Does anyone know why this bit of code inside a custom python component does not work?

 for i in range(len(circles)):
        domain = rs.CurveDomain(circles[i])
        domain[1] /= 2.0
        circles[i] = rs.TrimCurve(circles[i], domain)

Trying to trim a circle but it keeps returning:

Runtime error (NullReferenceException): Object reference not set to an instance of an object.

Traceback (most recent call last):
SystemError: Object reference not set to an instance of an object.

hard to tell without your file. the NullReferenceException is usually not your script but some set up problem
here I’ve pretty much re-typed your code verbatim and it’s fine…

forum-circletrim.gh (3.1 KB)

Lost the script I was working on so I guess I’ll never know what I did wrong but thanks!