Fix access violation in monodevelop 5.2
Merge pull request #504 from etcimon/master

Fix access violation in monodevelop 5.2