diff options
| author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-03-28 19:51:08 +0200 | 
|---|---|---|
| committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-03-28 19:51:08 +0200 | 
| commit | c2864468d69d6ef94ba6ec2db23729c490ec8f3d (patch) | |
| tree | e6549995dbdaf8a38f382fcb563604f3ef32f5a7 /indra/newview | |
| parent | 2bbb6c7e027ae12d18bef5db2cdc3e7ba41e8630 (diff) | |
SL-10766 Viewer is crashed after changing "day offset" settings
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/llpanelenvironment.cpp | 28 | 
1 files changed, 17 insertions, 11 deletions
| diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index b343c913e5..876b965fe9 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -686,30 +686,36 @@ void LLPanelEnvironmentInfo::readjustAltLabels()  void LLPanelEnvironmentInfo::onSldDayLengthChanged(F32 value)  { -    F32Hours daylength(value); +    if (mCurrentEnvironment) +    { +        F32Hours daylength(value); -    mCurrentEnvironment->mDayLength = daylength; -    setDirtyFlag(DIRTY_FLAG_DAYLENGTH); +        mCurrentEnvironment->mDayLength = daylength; +        setDirtyFlag(DIRTY_FLAG_DAYLENGTH); -    udpateApparentTimeOfDay(); +        udpateApparentTimeOfDay(); +    }  }  void LLPanelEnvironmentInfo::onSldDayOffsetChanged(F32 value)  { -    F32Hours dayoffset(value); +    if (mCurrentEnvironment) +    { +        F32Hours dayoffset(value); -    if (dayoffset.value() <= 0.0f) -        dayoffset += F32Hours(24.0); +        if (dayoffset.value() <= 0.0f) +            dayoffset += F32Hours(24.0); -    mCurrentEnvironment->mDayOffset = dayoffset; -    setDirtyFlag(DIRTY_FLAG_DAYOFFSET); +        mCurrentEnvironment->mDayOffset = dayoffset; +        setDirtyFlag(DIRTY_FLAG_DAYOFFSET); -    udpateApparentTimeOfDay(); +        udpateApparentTimeOfDay(); +    }  }  void LLPanelEnvironmentInfo::onDayLenOffsetMouseUp()  { -    if (getDirtyFlag() & (DIRTY_FLAG_DAYLENGTH | DIRTY_FLAG_DAYOFFSET)) +    if (mCurrentEnvironment && (getDirtyFlag() & (DIRTY_FLAG_DAYLENGTH | DIRTY_FLAG_DAYOFFSET)))      {          clearDirtyFlag(DIRTY_FLAG_DAYOFFSET);          clearDirtyFlag(DIRTY_FLAG_DAYLENGTH); | 
