Update BView to call debugger when passed a NULL archive for its archive constructor. This means there is no need to check for a NULL archive in BSeparatorView. Also update BUnarchiver and friends to be NULL safe. Pointed out by Adrien, fixes CID 1754.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38063 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
600170807a
commit
aa818be69a
@ -84,9 +84,7 @@ BSeparatorView::BSeparatorView(BMessage* archive)
|
||||
B_ALIGN_VERTICAL_CENTER)),
|
||||
fBorder(B_FANCY_BORDER)
|
||||
{
|
||||
// TODO: Test this.
|
||||
if (archive == NULL)
|
||||
return;
|
||||
// NULL archives will be caught by BView.
|
||||
|
||||
const char* label;
|
||||
if (archive->FindString("_labelview", &label) == B_OK) {
|
||||
|
@ -405,6 +405,8 @@ BView::BView(BMessage* archive)
|
||||
BHandler(BUnarchiver::PrepareArchive(archive))
|
||||
{
|
||||
BUnarchiver unarchiver(archive);
|
||||
if (!archive)
|
||||
debugger("BView cannot be constructed from a NULL archive.");
|
||||
|
||||
BRect frame;
|
||||
archive->FindRect("_frame", &frame);
|
||||
|
@ -511,6 +511,9 @@ BUnarchiver::IsArchiveManaged(const BMessage* archive)
|
||||
if (BManagerBase::ManagerPointer(archive))
|
||||
return true;
|
||||
|
||||
if (!archive)
|
||||
return false;
|
||||
|
||||
// managed top level archives return here
|
||||
bool dummy;
|
||||
if (archive->FindBool(kManagedField, &dummy) == B_OK)
|
||||
|
@ -43,6 +43,9 @@ public:
|
||||
static BManagerBase*
|
||||
ManagerPointer(const BMessage* constArchive)
|
||||
{
|
||||
if (!constArchive)
|
||||
return NULL;
|
||||
|
||||
BMessage* archive = const_cast<BMessage*>(constArchive);
|
||||
|
||||
return static_cast<BManagerBase*>(
|
||||
|
Loading…
Reference in New Issue
Block a user