fix crash
This commit is contained in:
parent
3f593517e1
commit
3a4cb9e025
|
@ -287,10 +287,8 @@ namespace telegram {
|
||||||
if (results.ChatIds.Length == 0)
|
if (results.ChatIds.Length == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return results.ChatIds.Select(GetChat)
|
var output = results.ChatIds.Select(GetChat).Where(p => p.Type is ChatType.ChatTypePrivate).Select(p => ((ChatType.ChatTypePrivate) p.Type).UserId);
|
||||||
.Where(p => p.Type is ChatType.ChatTypePrivate)
|
return output.Any() ? output.First() : 0;
|
||||||
.Select(p => ((ChatType.ChatTypePrivate) p.Type).UserId)
|
|
||||||
.First();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int SearchContacts(string query) {
|
public static int SearchContacts(string query) {
|
||||||
|
|
Loading…
Reference in a new issue