Gio: prevent NRE when scanning for CD device (bgo#721203)
commit20bacf9a3d06b2d136b474319f0b8224947bc4b8
authorAndrés G. Aragoneses <knocte@gmail.com>
Sun, 29 Dec 2013 18:45:29 +0000 (29 19:45 +0100)
committerAndrés G. Aragoneses <knocte@gmail.com>
Sun, 29 Dec 2013 18:45:29 +0000 (29 19:45 +0100)
treeec251d83aacfe61b16ff1bddb0bdaebc29f9e4a1
parenta7d5570caaef0f18586429af8ab70ecf8e012247
Gio: prevent NRE when scanning for CD device (bgo#721203)

This is a similar fix to the one for BGO#699735 which consists
in detecting a null value earlier before creating an instance
of UdevMetadataSource class.

This time we also throw ArgumentNullException now in the ctor
of this class to fail faster when this situation happens,
instead of failing when some code queries any property of
an object of this class which happened to wrap a null value.

[1] https://git.gnome.org/browse/banshee/commit/?h=stable-2.6&id=1f8d8746eb122449a3489901a87f8a15e54ae4cf
src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawBlockDevice.cs
src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/UdevMetadataSource.cs