diff --git a/src/kits/interface/SeparatorView.cpp b/src/kits/interface/SeparatorView.cpp index 0962aa0ce3..a464f58e4e 100644 --- a/src/kits/interface/SeparatorView.cpp +++ b/src/kits/interface/SeparatorView.cpp @@ -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) { diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index 500b639175..e3163cfbde 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -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); diff --git a/src/kits/support/Archivable.cpp b/src/kits/support/Archivable.cpp index 7f84a20123..a01af34aa0 100644 --- a/src/kits/support/Archivable.cpp +++ b/src/kits/support/Archivable.cpp @@ -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) diff --git a/src/kits/support/ArchivingManagers.h b/src/kits/support/ArchivingManagers.h index 7137e771ce..76423521b5 100644 --- a/src/kits/support/ArchivingManagers.h +++ b/src/kits/support/ArchivingManagers.h @@ -43,6 +43,9 @@ public: static BManagerBase* ManagerPointer(const BMessage* constArchive) { + if (!constArchive) + return NULL; + BMessage* archive = const_cast(constArchive); return static_cast(