From 81ed530191371917fea296e7aae85838b11199bf Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Fri, 25 May 2001 16:08:27 +0000 Subject: [PATCH] ICU-597 One of the tests calls the copy constructor on as/400 on a bad resource bundle, while the other platforms seem to optimize away the extra call to the copy constructor. X-SVN-Rev: 4794 --- icu4c/source/common/resbund.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/icu4c/source/common/resbund.cpp b/icu4c/source/common/resbund.cpp index a55a8cf07e..2f994d3322 100644 --- a/icu4c/source/common/resbund.cpp +++ b/icu4c/source/common/resbund.cpp @@ -249,13 +249,18 @@ ResourceBundle::ResourceBundle(const wchar_t* path, ResourceBundle::ResourceBundle(const ResourceBundle &other) { UErrorCode status = U_ZERO_ERROR; - if(other.resource->fIsTopLevel == TRUE) { - constructForLocale(ures_getPath(other.resource), Locale(ures_getName(other.resource)), status); - } else { + if (other.resource) { + if(other.resource->fIsTopLevel == TRUE) { + constructForLocale(ures_getPath(other.resource), Locale(ures_getName(other.resource)), status); + } else { #ifdef ICU_RESBUND_USE_DEPRECATES - fItemCache = 0; + fItemCache = 0; #endif - resource = copyResb(0, other.resource, &status); + resource = copyResb(0, other.resource, &status); + } + } else { + /* Copying a bad resource bundle */ + resource = NULL; } }