diff options
| author | liangweikang <liangweikang900911@gmail.com> | 2017-03-16 19:22:15 +0800 |
|---|---|---|
| committer | weikang liang <liangweikang900911@gmail.com> | 2017-03-17 02:59:49 +0000 |
| commit | 63b03b573fccd87dab584a135073a4bb1ca19197 (patch) | |
| tree | d47c888208141780b796c3f286865b044b4538fc /core/java | |
| parent | ef9c4254166203099929c96689775970846e3859 (diff) | |
[BUG] fix NullPointerException in Notification.java
https://code.google.com/p/android/issues/detail?id=252835
Test: null
Change-Id: I6c575686c75b02ac938f35622b522fff25403c29
Signed-off-by: liangweikang <liangweikang900911@gmail.com>
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/Notification.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 0dd9c63c40c5..bcdf3f492516 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -1761,7 +1761,9 @@ public class Notification implements Parcelable if (this.actions != null) { that.actions = new Action[this.actions.length]; for(int i=0; i<this.actions.length; i++) { - that.actions[i] = this.actions[i].clone(); + if ( this.actions[i] != null) { + that.actions[i] = this.actions[i].clone(); + } } } @@ -3108,7 +3110,9 @@ public class Notification implements Parcelable * @param action The action to add. */ public Builder addAction(Action action) { - mActions.add(action); + if (action != null) { + mActions.add(action); + } return this; } @@ -3122,7 +3126,9 @@ public class Notification implements Parcelable public Builder setActions(Action... actions) { mActions.clear(); for (int i = 0; i < actions.length; i++) { - mActions.add(actions[i]); + if (actions[i] != null) { + mActions.add(actions[i]); + } } return this; } |
