AttackPattern / CSharpAnalytics

Google Analytics for Windows 8, Windows Phone & desktop applications
142 stars 36 forks source link

Not relying on exception for program flow #34

Open redsolo opened 9 years ago

redsolo commented 9 years ago

If I run our application with the library and would like to catch all exceptions not only those unhandled; then the Restore method will always throw an exception (if there id no file). With this change it will check if it exists and then return the default if it didnt exist. There is no need to try to read the stream from the file because it will not be there.