After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 547092 - Dragging a track from mirage to a playlist crashes banshee
Dragging a track from mirage to a playlist crashes banshee
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-08-09 18:53 UTC by Bertrand Lorentz
Modified: 2008-08-16 10:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Check if the model is null (663 bytes, patch)
2008-08-09 18:55 UTC, Bertrand Lorentz
committed Details | Review

Description Bertrand Lorentz 2008-08-09 18:53:30 UTC
What steps will reproduce the problem ?
1. Select a track in the mirage track list
2. Drag and drop it to the play queue or a playlist

Banshee crashes with this stacktrace :
Object reference not set to an instance of an object
System.NullReferenceException: Object reference not set to an instance of
an object
  at Banshee.Sources.DatabaseSource.WithTrackSelection
(Banshee.Collection.Database.DatabaseTrackListModel model,
Banshee.Sources.TrackRangeHandler handler) [0x00000] in
/var/tmp/portage/media-sound/banshee-1.2.0/work/banshee-1-1.2.0/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs:606
  at Banshee.Sources.DatabaseSource.AddSelectedTracks
(Banshee.Sources.Source source) [0x0001f] in
/var/tmp/portage/media-sound/banshee-1.2.0/work/banshee-1-1.2.0/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs:417
  at Banshee.Playlist.PlaylistSource.AddSelectedTracks
(Banshee.Sources.Source source) [0x00028] in
/var/tmp/portage/media-sound/banshee-1.2.0/work/banshee-1-1.2.0/src/Core/Banshee.Services/Banshee.Playlist/PlaylistSource.cs:236
  at Banshee.Sources.DatabaseSource.MergeSourceInput
(Banshee.Sources.Source source, SourceMergeType mergeType) [0x00022] in
/var/tmp/portage/media-sound/banshee-1.2.0/work/banshee-1-1.2.0/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs:472
  at Banshee.Sources.Gui.SourceView.OnDragDataReceived (Gdk.DragContext
context, Int32 x, Int32 y, Gtk.SelectionData data, UInt32 info, UInt32
time) [0x00146] in
/var/tmp/portage/media-sound/banshee-1.2.0/work/banshee-1-1.2.0/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView_DragAndDrop.cs:231
  at Gtk.Widget.dragdatareceived_cb (IntPtr widget, IntPtr context, Int32
x, Int32 y, IntPtr selection_data, UInt32 info, UInt32 time_) [0x00000] 
  at (wrapper native-to-managed) Gtk.Widget:dragdatareceived_cb
(intptr,intptr,int,int,intptr,uint,uint)
  at (wrapper managed-to-native) Gtk.Application:gtk_main ()
  at Gtk.Application.Run () [0x00000] 
  at Banshee.Gui.GtkBaseClient.Run () [0x00027] in
/var/tmp/portage/media-sound/banshee-1.2.0/work/banshee-1-1.2.0/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:114
  at Banshee.Gui.GtkBaseClient.Startup () [0x00000] in
/var/tmp/portage/media-sound/banshee-1.2.0/work/banshee-1-1.2.0/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:55
  at Hyena.Gui.CleanRoomStartup.Startup (Hyena.Gui.StartupInvocationHandler
startup) [0x00048] in
/var/tmp/portage/media-sound/banshee-1.2.0/work/banshee-1-1.2.0/src/Libraries/Hyena.Gui/Hyena.Gui/CleanRoomStartup.cs:54


The crash happens because banshee assumes the track comes from a source that has a DatabaseTrackListModel. Mirage uses a MemoryTrackListModel.
Other sources that currently use a MemoryTrackListModel don't allow drag and drop, so they are not affected.

I'll attach a patch that prevents the crash.
Comment 1 Bertrand Lorentz 2008-08-09 18:55:16 UTC
Created attachment 116258 [details] [review]
Check if the model is null

Simple patch to check if the cast of the TrackModel to DatabaseTrackListModel succeeded.
Comment 2 Bertrand Lorentz 2008-08-16 10:16:35 UTC
Committed.