roji / AsyncRewriter

Uses Roslyn to rewrite synchronous C# methods into async counterparts
MIT License
54 stars 10 forks source link

Fix null reference exception when running under Mono #7

Closed franciscojunior closed 9 years ago

franciscojunior commented 9 years ago

When running under Mono, Log property is null and then, Rewriter throws NullReferenceExceptions when trying to use the underlying Log.

When Log is null, use the default Rewriter constructor which uses a Console logger.

@roji , I tested this patch and it worked ok. It allowed me to compile Npgsql develop branch with Xamarin Studio on OSX.

roji commented 9 years ago

Great, thanks for looking into this @franciscojunior! I'll make the changes to make Npgsql depend on the new version with your fix.

Thanks!

franciscojunior commented 9 years ago

You are more than welcome, @roji! I'm very glad I could help fix this issue! And thank you for your tip which lead me directly to the point!

On Fri, May 29, 2015 at 2:58 AM, Shay Rojansky notifications@github.com wrote:

Great, thanks for looking into this @franciscojunior https://github.com/franciscojunior! I'll make the changes to make Npgsql depend on the new version with your fix.

Thanks!

— Reply to this email directly or view it on GitHub https://github.com/roji/AsyncRewriter/pull/7#issuecomment-106699695.

Regards,

Francisco Figueiredo Jr. Npgsql Lead Developer http://www.npgsql.org http://gplus.to/franciscojunior http://fxjr.blogspot.com http://twitter.com/franciscojunior