fix potential crash when rendering lines with shapes