multiformats / js-cid

CID implementation in JavaScript
MIT License
97 stars 39 forks source link

fix: throw on toString when create new CID from old CID #91

Closed alanshaw closed 5 years ago

alanshaw commented 5 years ago

When creating a CID from another CID instance that was created by and old version of this module (< 0.7) the multibaseName property would become undefined and cause an error to be thrown when calling toString. This PR ensures an appropriate multibaseName is picked in the edge case that this happens.