mirror of
https://github.com/rclone/rclone.git
synced 2026-05-12 10:03:35 -04:00
When Mega.LoginWithKeys() fails to make the API request, it leaves the object in a state where Mega.FS.root is nil because it could never query any information about the filesystem tree. An easy way for this to happen is if the device is not connected to the internet. Previously, these failures would be ignored, but Fs.findRoot() on the rclone side is written in a way that assumes the go-meta filesystem will have a non-nil root. This leads to an immediate nil pointer dereference when NewFs() calls Fs.findRoot(). This commit fixes the problem by making LoginWithKeys() failures hard failures, similar to the MultiFactorLogin() path. Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>