added some checks

This commit is contained in:
John Preston
2015-10-03 14:33:51 +03:00
parent e3e774176e
commit 605b18aa27
12 changed files with 39 additions and 29 deletions
+5 -3
View File
@@ -385,7 +385,7 @@ void ChannelData::setPhoto(const MTPChatPhoto &p, const PhotoId &phId) { // see
photoId = newPhotoId;
photo = newPhoto;
photoLoc = newPhotoLoc;
emit App::main()->peerPhotoChanged(this);
if (App::main()) emit App::main()->peerPhotoChanged(this);
}
}
@@ -397,8 +397,10 @@ void ChannelData::setName(const QString &newName, const QString &usern) {
void ChannelData::updateFull(bool force) {
if (!_lastFullUpdate || force || getms(true) > _lastFullUpdate + UpdateFullChannelTimeout) {
App::api()->requestFullPeer(this);
if (!amCreator() && !inviter) App::api()->requestSelfParticipant(this);
if (App::api()) {
App::api()->requestFullPeer(this);
if (!amCreator() && !inviter) App::api()->requestSelfParticipant(this);
}
}
}