Alxandr / SpotiFire

A project to make a SpotifyClient in C#
http://nudoc.azurewebsites.net/SpotiFire
40 stars 19 forks source link

Add IsLoaded checking & NotLoadedException for properties of Spotify types #37

Closed ChrisBrandhorst closed 11 years ago

ChrisBrandhorst commented 11 years ago

In order to prevent AccessViolationExceptions, we need to add IsLoaded checks to properties of Spotify types. If IsLoaded returns false, those properties should throw a NotLoadedException.

The following types should be addressed:

Alxandr commented 11 years ago

Also, for performance-reasons (due to locking), IsLoaded itself should not be called, rather the sp_*_is_loaded should.

Alxandr commented 11 years ago

Actually, thinking about it, I think that maybe all API's should throw a NotLoadedException when relevant, simply because that's a LOT easier to track down than a random NullReferenceException that doesn't occur if you set breakpoints (cause then things have time to load).

ChrisBrandhorst commented 11 years ago

Agreed. I should have the NotLoadedException somewhere in the commits, since I already added it once, but removed it later :-)

Alxandr commented 11 years ago

Lets just remake it. It's too messy drawing things back from old commits imho.