From e7c9f674945533e4a56313b74746886bdb724be2 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 10 Feb 2010 18:40:13 +0000 Subject: CID-136 Checker: NULL_RETURNS Function: LLInventorySort::operator ()(const LLFolderViewItem *const &, const LLFolderViewItem *const &) File: /indra/newview/llfolderviewitem.cpp --- indra/newview/llfolderviewitem.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfolderviewitem.cpp') diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 20cb2d3604..2a77835373 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -2544,8 +2544,12 @@ bool LLInventorySort::operator()(const LLFolderViewItem* const& a, const LLFolde { // *TODO: mantipov: probably it is better to add an appropriate method to LLFolderViewItem // or to LLInvFVBridge - S32 a_sort = (static_cast(a->getListener()))->getItem()->getSortField(); - S32 b_sort = (static_cast(b->getListener()))->getItem()->getSortField(); + LLViewerInventoryItem* aitem = (static_cast(a->getListener()))->getItem(); + LLViewerInventoryItem* bitem = (static_cast(b->getListener()))->getItem(); + if (!aitem || !bitem) + return false; + S32 a_sort = (aitem->getSortField(); + S32 b_sort = (bitem->getSortField(); return a_sort < b_sort; } } -- cgit v1.2.3