mega: skip undecodable FSNodes - #3740 - FIXME vendor patch DO NOT MERGE

Also test whether we have a decryption key for shared nodes
This commit is contained in:
Nick Craig-Wood 2019-11-17 16:43:53 +00:00
parent e14d968f8d
commit c48424c0eb

View File

@ -750,7 +750,10 @@ func (m *Mega) addFSNode(itm FSNode) (*Node, error) {
}
// Shared file
default:
k := m.FS.skmap[args[0]]
k, ok := m.FS.skmap[args[0]]
if !ok {
return nil, errors.New("couldn't find decryption key for shared file")
}
b, err := base64urldecode(k)
if err != nil {
return nil, err
@ -921,7 +924,8 @@ func (m *Mega) getFileSystem() error {
for _, itm := range res[0].F {
_, err = m.addFSNode(itm)
if err != nil {
return err
m.debugf("couldn't decode FSNode %#v: %v ", itm, err)
continue
}
}