+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
* Copyright (C) 2009-2012, International Business Machines Corporation and
// Verify that adopt has valid data, and update status if it doesn't.
if (U_SUCCESS(status)) {
if (adopt) {
- if ((adopt->size() % 3) != 0) {
+ if (adopt->size() == 0) {
+ delete adopt;
+ adopt = NULL;
+ } else if ((adopt->size() % 3) != 0) {
status = U_ILLEGAL_ARGUMENT_ERROR;
} else {
for (int i = 1; i < adopt->size(); i += 3) {