diff options
Diffstat (limited to 'indra/newview/llpreviewnotecard.cpp')
-rw-r--r-- | indra/newview/llpreviewnotecard.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index fec16998d6..9a0a80147a 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -110,13 +110,15 @@ bool LLPreviewNotecard::saveItem() void LLPreviewNotecard::setEnabled( BOOL enabled ) { - - LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); - - getChildView("Notecard Editor")->setEnabled(enabled); - getChildView("lock")->setVisible( !enabled); - getChildView("desc")->setEnabled(enabled); - getChildView("Save")->setEnabled(enabled && editor && (!editor->isPristine())); + LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("Notecard Editor"); + // editor is part of xml, if it doesn't exists, nothing else does + if (editor) + { + editor->setEnabled(enabled); + getChildView("lock")->setVisible( !enabled); + getChildView("desc")->setEnabled(enabled); + getChildView("Save")->setEnabled(enabled && (!editor->isPristine())); + } } |