tmpvar / stl

parse/serialize stl files
29 stars 7 forks source link

Description is not optional #5

Open mikaello opened 4 years ago

mikaello commented 4 years ago

The README states that the description-field is optional: https://github.com/tmpvar/stl/blame/8b69a40281c7828cd89743f73cac8f942643c722/README.md#L42

This is not the case. Since the description is trimmed without checking for undefined, it will crash if you don't pass in description: https://github.com/tmpvar/stl/blob/e9f72df61b88e8368980d7cb7f261e04094467dc/stl.js#L61

Solution: Remove optional from readme, check for undefined before trimming or give default value.