Fixed
Status Update
Comments
wk...@google.com <wk...@google.com>
il...@google.com <il...@google.com> #2
since these are in public API (:/) we need to do this in 1.2
No update yet.
Description
Version used: 1.0.0-alpha03
If I have an argument that is non-null, it is possible to construct a Args instance that still has that value as null by using:
Bundle bundle = new Bundle();
bundle.putString("value", null);
Since the fromBundle() method just checks for the existence of the key and does not confirm that the value in that key is truly not null:
if (bundle.containsKey("value")) {
result.value = bundle.getString("value");
} else {
throw new IllegalArgumentException("Required argument \"value\" is missing and does not have an android:defaultValue");
}
It should throw an IllegalArgumentException if bundle.getString("value") in my example is null. The error message could read something like "Argument \"value\" is marked as non-null but was passed a null value"