Commit 286d2989 authored by Andrés G. Aragoneses's avatar Andrés G. Aragoneses

Dap: prevent crash by checking if library was not found (bgo#614039)

As the stacktrace in comment#1 of bug#614039 shows
it could happen that the source is not found by the
RemoveLibrary() method.

Note: this had a slightly confusing exception message
because in old versions of mono there was a bug about
this, which was fixed in mono, actually by yours truly:

This fixes the first part of bgo#614039.
parent 62eed898
......@@ -192,7 +192,12 @@ namespace Banshee.Dap
var library = GetSyncableLibrary (source);
if (library != null) {
var sync = library_syncs.First (s => s.Library == library);
var sync = library_syncs.FirstOrDefault (s => s.Library == library);
if (sync == null) {
library_syncs.Remove (sync);
sync.Library.TracksAdded -= OnLibraryChanged;
sync.Library.TracksDeleted -= OnLibraryChanged;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment