gphotosuploader / google-photos-api-client-go

Google Photos API client for your Go apps
https://pkg.go.dev/github.com/gphotosuploader/google-photos-api-client-go/v3
MIT License
41 stars 20 forks source link

Panic using v1.1.1 (due to Mutex) #28

Closed pacoorozco closed 5 years ago

pacoorozco commented 5 years ago
./gphotos-uploader-cli                                   
Enter passphrase to unlock /home/paco/.config/gphotos-uploader-cli: 
2019/10/12 18:26:27 Token expiration: 2019-10-12 19:24:50.99081676 +0200 CEST
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x46f55d]

goroutine 1 [running]:
sync.(*Mutex).Lock(0x0)
        /snap/go/4520/src/sync/mutex.go:74 +0x2d
github.com/gphotosuploader/google-photos-api-client-go/lib-gphotos.(*Client).GetOrCreateAlbumByName(0xc000093500, 0xc00002b0a5, 0x7, 0x0, 0x0, 0x0)
        /home/paco/src/go/pkg/mod/github.com/gphotosuploader/google-photos-api-client-go@v1.1.1/lib-gphotos/albums.go:68 +0x68
github.com/gphotosuploader/gphotos-uploader-cli/upload.getGooglePhotosAlbumID(0xc00002b0a5, 0x7, 0xc000093500, 0x7, 0x0)
        /home/paco/src/gphotos-uploader-cli/upload/folderUploadJob.go:134 +0x4f
github.com/gphotosuploader/gphotos-uploader-cli/upload.(*Job).ScanFolder.func1(0xc00002b080, 0x39, 0xa2ba40, 0xc0001451e0, 0x0, 0x0, 0x4c8fda, 0xc0001451e0)
        /home/paco/src/gphotos-uploader-cli/upload/folderUploadJob.go:104 +0x2d4
path/filepath.walk(0xc00002b080, 0x39, 0xa2ba40, 0xc0001451e0, 0xc000093560, 0x0, 0x0)
        /snap/go/4520/src/path/filepath/path.go:358 +0x426
path/filepath.walk(0xc00002c450, 0x2c, 0xa2ba40, 0xc000145040, 0xc000093560, 0x0, 0x0)
        /snap/go/4520/src/path/filepath/path.go:382 +0x300
path/filepath.walk(0xc00002c270, 0x24, 0xa2ba40, 0xc000144ea0, 0xc000093560, 0x0, 0x30)
        /snap/go/4520/src/path/filepath/path.go:382 +0x300
path/filepath.Walk(0xc00002c270, 0x24, 0xc000093560, 0x0, 0x11)
        /snap/go/4520/src/path/filepath/path.go:404 +0xff
github.com/gphotosuploader/gphotos-uploader-cli/upload.(*Job).ScanFolder(0xc000093530, 0xc000030a80, 0xc000010090, 0x0)
        /home/paco/src/gphotos-uploader-cli/upload/folderUploadJob.go:67 +0x11d
github.com/gphotosuploader/gphotos-uploader-cli/cmd.startUploader(0xd9fde0, 0xdc2768, 0x0, 0x0)
        /home/paco/src/gphotos-uploader-cli/cmd/root.go:125 +0x96e
github.com/spf13/cobra.(*Command).execute(0xd9fde0, 0xc000090190, 0x0, 0x0, 0xd9fde0, 0xc000090190)
        /home/paco/src/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:830 +0x2ae
github.com/spf13/cobra.(*Command).ExecuteC(0xd9fde0, 0xc0000d1f68, 0x85f90e, 0xd9fde0)
        /home/paco/src/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914 +0x2fc
github.com/spf13/cobra.(*Command).Execute(...)
        /home/paco/src/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864
github.com/gphotosuploader/gphotos-uploader-cli/cmd.Execute()
        /home/paco/src/gphotos-uploader-cli/cmd/root.go:43 +0x32
main.main()
        /home/paco/src/gphotos-uploader-cli/main.go:8 +0x20