mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fixed another crash in IdEditDialog::createId when avatar is not set.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7887 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4cab5dc743
commit
7cfd50f860
@ -470,22 +470,22 @@ void IdEditDialog::createId()
|
||||
|
||||
RsIdentityParameters params;
|
||||
params.nickname = groupname;
|
||||
params.isPgpLinked = (ui.radioButton_GpgId->isChecked());
|
||||
params.isPgpLinked = (ui.radioButton_GpgId->isChecked());
|
||||
|
||||
const QPixmap *pixmap = ui.avatarLabel->pixmap();
|
||||
const QPixmap *pixmap = ui.avatarLabel->pixmap();
|
||||
|
||||
if (!pixmap->isNull())
|
||||
{
|
||||
QByteArray ba;
|
||||
QBuffer buffer(&ba);
|
||||
if (pixmap && !pixmap->isNull())
|
||||
{
|
||||
QByteArray ba;
|
||||
QBuffer buffer(&ba);
|
||||
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pixmap->save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pixmap->save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
|
||||
params.mImage.copy((uint8_t *) ba.data(), ba.size());
|
||||
}
|
||||
else
|
||||
params.mImage.clear();
|
||||
params.mImage.copy((uint8_t *) ba.data(), ba.size());
|
||||
}
|
||||
else
|
||||
params.mImage.clear();
|
||||
|
||||
uint32_t dummyToken = 0;
|
||||
rsIdentity->createIdentity(dummyToken, params);
|
||||
|
Loading…
Reference in New Issue
Block a user