i adopted that part from lineSegment.remove (#L1483).
at first i thought you might be right because lineSegment.temp is not initialized until lineSegment.transform is called, but it is called at the end of addMovableLineSegment (#L1629).