Hello all,
I have a Win form application which is using a Timer to update the interface at every 1000 miliseconds. Now, when the first Tick is being performed the application crashes, the Mono framework closes and the following error is dumped on the Terminal:
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
at VideoUploader.MainWindow.updateUploadProgress_Tick (System.Object sender, System.EventArgs e) [0x00000]
at System.Windows.Forms.Timer.OnTick (System.EventArgs e) [0x00000]
at System.Windows.Forms.Timer.FireTick () [0x00000]
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Timer:FireTick ()
at System.Windows.Forms.XplatUICarbon.CheckTimers (DateTime now) [0x00000]
at System.Windows.Forms.XplatUICarbon.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, IntPtr hWnd, Int32 wFilterMin, Int32 wFilterMax) [0x00000]
at System.Windows.Forms.XplatUI.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, IntPtr hWnd, Int32 wFilterMin, Int32 wFilterMax) [0x00000]
at System.Windows.Forms.Application.RunLoop (Boolean Modal, System.Windows.Forms.ApplicationContext context) [0x00000]
at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext context) [0x00000]
at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm) [0x00000]
at VideoUploader.Program.Main () [0x00000]
[Process completed]
The application is started with the following command: mono VideoUploader.exe and the relevant piece of code is this:
[code]
private Videos videos;
private void updateUploadProgress_Tick(object sender, EventArgs e) {
if (videos != null) {
//update some Labels on UI
}
}
[/code]
the "videos" object is created before issuing the Timer
Thank you in advance,
Ionut Voda