From 73de7ce4ecc794375bf092e3b0a293bf1385f506 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Thu, 24 Jul 2014 22:47:22 -0400 Subject: [PATCH] Tracker: check that textControl->TextView() isn't NULL --- src/kits/tracker/FindPanel.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/kits/tracker/FindPanel.cpp b/src/kits/tracker/FindPanel.cpp index 66fb9a09e3..cd42ad8264 100644 --- a/src/kits/tracker/FindPanel.cpp +++ b/src/kits/tracker/FindPanel.cpp @@ -510,8 +510,9 @@ FindWindow::SaveQueryAsAttributes(BNode* file, BEntry* entry, BString name(focusedItem->Name()); file->WriteAttrString("_trk/focusedView", &name); BTextControl* textControl = dynamic_cast(focusedItem); - if (textControl) { - int32 selStart, selEnd; + if (textControl != NULL && textControl->TextView() != NULL) { + int32 selStart; + int32 selEnd; textControl->TextView()->GetSelection(&selStart, &selEnd); file->WriteAttr("_trk/focusedSelStart", B_INT32_TYPE, 0, &selStart, sizeof(selStart)); @@ -920,10 +921,9 @@ FindPanel::AttachedToWindow() // pick the last text control in the attribute view BString title("TextEntry"); title << (fAttrGrid->CountRows() - 1); - textControl - = dynamic_cast(FindView(title.String())); + textControl = dynamic_cast(FindView(title.String())); } - if (textControl) + if (textControl != NULL) textControl->MakeFocus(); }