FIRE-32893 - fix crash on image upload, make sure to grab the checkbox pointer even when there is no alpha channel at all

master
Zi Ree 2023-04-20 03:49:52 +02:00
parent ab64614bbc
commit 1ac600f383
1 changed files with 2 additions and 2 deletions

View File

@ -186,6 +186,8 @@ BOOL LLFloaterImagePreview::postBuild()
getChild<LLUICtrl>("uploaded_size_text")->setTextArg("[X_RES]", llformat("%d", mRawImagep->getWidth()));
getChild<LLUICtrl>("uploaded_size_text")->setTextArg("[Y_RES]", llformat("%d", mRawImagep->getHeight()));
mEmptyAlphaCheck = getChild<LLCheckBoxCtrl>("strip_alpha_check");
if (mRawImagep->getComponents() != 4)
{
getChild<LLUICtrl>("image_alpha_warning")->setVisible(false);
@ -205,8 +207,6 @@ BOOL LLFloaterImagePreview::postBuild()
}
}
mEmptyAlphaCheck = getChild<LLCheckBoxCtrl>("strip_alpha_check");
if (emptyAlphaCount > (imageBytes / 4 * ALPHA_EMPTY_THRESHOLD_RATIO))
{
getChild<LLUICtrl>("image_alpha_warning")->setVisible(true);