Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5f9d735 authored by George Mount's avatar George Mount
Browse files

Make more descriptive exception for null viewName.

Bug 15114583

Change-Id: I73db179e032947843e3f9a7f1cc5228cbf6fc22b
parent 262d905e
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -394,8 +394,18 @@ public class ActivityOptions {
        if (sharedElements != null) {
            for (int i = 0; i < sharedElements.length; i++) {
                Pair<View, String> sharedElement = sharedElements[i];
                names.add(sharedElement.second);
                mappedNames.add(sharedElement.first.getViewName());
                String sharedElementName = sharedElement.second;
                if (sharedElementName == null) {
                    throw new IllegalArgumentException("Shared element name must not be null");
                }
                String viewName = sharedElement.first.getViewName();
                if (viewName == null) {
                    throw new IllegalArgumentException("Shared elements must have non-null " +
                            "viewNames");
                }

                names.add(sharedElementName);
                mappedNames.add(viewName);
            }
        }

+4 −0
Original line number Diff line number Diff line
@@ -340,6 +340,10 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
                String name = mAllSharedElementNames.get(i);
                View sharedElement = sharedElements.get(name);
                if (sharedElement != null) {
                    if (sharedElement.getViewName() == null) {
                        throw new IllegalArgumentException("Shared elements must have " +
                                "non-null viewNames");
                    }
                    mSharedElementNames.add(name);
                    mSharedElements.add(sharedElement);
                }