1

Closed

Crash when can't reach the server EventService is null

description

In Mainform.cs function Showsubscription should be like this
 
    private void ShowSubscriptions()
    {
        Shared.ConnectServer(serverListComboBox.Text);
 
        subscriptionslistView.Items.Clear();
 
Added--> if (Shared.EventService != null)
        {
            Subscription[] subscriptions = Shared.EventService.EventSubscriptions(userTextBox.Text);
 
            foreach (Subscription subscription in subscriptions)
            {
                ListViewItem item = new ListViewItem(subscription.ID.ToString());
 
                item.SubItems.Add(subscription.EventType);
                item.SubItems.Add(subscription.ConditionString);
                item.SubItems.Add(subscription.DeliveryPreference.Type.ToString());
                item.SubItems.Add(subscription.DeliveryPreference.Address);
 
                subscriptionslistView.Items.Add(item);
            }
        }
    }
 
If you don't have this when it can't connect it causes an error and the app crashes.
 
Cheers,
 
ET
Closed Apr 25, 2007 at 9:11 PM by jatwood

comments

etiennetremblay wrote Apr 25, 2007 at 9:11 PM

Btw I meant to say, great job on the tool ;-).

Cheers,

ET