Using crash when saving source files?

Hi,

I’ve a problem where if I modify source files whilst Unity is running my program, the program crashes with a:

NullReferenceException: Object reference not set to an instance of an object

Everything runs perfectly ifI just leave it soak testing. But as soon as I go into MonoDevelop, modify and save a file, and then go back into Unity3D (eg. put it back into focus by clicking on the Unity3D editor window), I get this error.

Indeed, checking the error, it seems that for some reason, it’s null’d one of the game parameters…

Anyone else had this problem / know of a fix? (And, yes, I could put null checks around everything where I use this param, but the problem is that for some reason, it’s getting set to null only when I save source code!)

Thanks in advance.

J

A bit more info:
If I turn auto refresh off from preferences, the problem goes away.
So I can manually then just recompile before starting up again…

But, again, if I try to recompile while the current version is still playing, I get the same crashes.