Null-Check bei Klick auf Benachrichtigung. Führte zu Exception im BeWoPlaner
This commit is contained in:
@@ -236,6 +236,11 @@ namespace ChatController
|
||||
{
|
||||
DisposeAndRemoveNotification((NotifyIcon)sender, pGroupId);
|
||||
|
||||
if(_ContainingWindow == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_ContainingWindow.WindowState == WindowState.Minimized)
|
||||
{
|
||||
_ContainingWindow.WindowState = WindowState.Normal;
|
||||
@@ -243,7 +248,11 @@ namespace ChatController
|
||||
|
||||
_ContainingWindow.Activate();
|
||||
|
||||
SelectContact(_ContactList.FirstOrDefault(f => f.GroupId.Equals(pGroupId)));
|
||||
var selectedContact = _ContactList?.FirstOrDefault(f => f?.GroupId == pGroupId);
|
||||
if(selectedContact != null)
|
||||
{
|
||||
SelectContact(selectedContact);
|
||||
}
|
||||
};
|
||||
|
||||
notifyIcon.BalloonTipClosed += (sender, args) =>
|
||||
@@ -298,9 +307,9 @@ namespace ChatController
|
||||
|
||||
private void Clientlist_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if(Clientlist.SelectedItem != null)
|
||||
if(Clientlist?.SelectedItem != null && Clientlist?.SelectedItem is Contact selectedContact)
|
||||
{
|
||||
SelectContact((Contact) Clientlist.SelectedItem);
|
||||
SelectContact(selectedContact);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1111,11 +1120,17 @@ namespace ChatController
|
||||
}
|
||||
|
||||
// Wird im BeWoPlaner benutzt
|
||||
public Contact GetCurrentContact()
|
||||
public Contact GetCurrentContactWithUserIdManage()
|
||||
{
|
||||
return CurrentContact?.UserIdManage != null ? CurrentContact : null;
|
||||
}
|
||||
|
||||
// Wird im BeWoPlaner benutzt
|
||||
public Contact GetCurrentContact()
|
||||
{
|
||||
return CurrentContact;
|
||||
}
|
||||
|
||||
// Wird im BeWoPlaner benutzt
|
||||
public void AddContextMenu(string menuItemText, Action<string> callBackAction)
|
||||
{
|
||||
|
||||
@@ -485,7 +485,7 @@ namespace ChatController.HauptKlassen
|
||||
request.AddParameter(Constants.CustomerId, ChatDaten.Kundennummer);
|
||||
|
||||
request.AddParameter(Constants.MultipartContentTypeValue, requestBody, ParameterType.RequestBody);
|
||||
|
||||
|
||||
client.PostAsync(request, (response, handle) =>
|
||||
{
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user