Before this fix, if an error ocurred reading the metadata, it could be set as nil and then used, causing a crash. This fix changes the readMetadata function so it returns an error, and the error is always set if the metadata returned is nil.
Before this fix, if an error ocurred reading the metadata, it could be set as nil and then used, causing a crash. This fix changes the readMetadata function so it returns an error, and the error is always set if the metadata returned is nil.