Skip to content

Commit a576ec7

Browse files
committed
Merge pull request #2878 from wordpress-mobile/issue/2860-npe-post-settings-update
Fixing #2860 - potential NPEs when updating a post object
2 parents 3f98bb1 + 0105cee commit a576ec7

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

WordPressUtils/src/main/java/org/wordpress/android/util/EditTextUtils.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.text.TextUtils;
55
import android.view.inputmethod.InputMethodManager;
66
import android.widget.EditText;
7+
import android.widget.TextView;
78

89
/**
910
* EditText utils
@@ -14,13 +15,10 @@ private EditTextUtils() {
1415
}
1516

1617
/**
17-
* returns text string from passed EditText
18+
* returns non-null text string from passed TextView
1819
*/
19-
public static String getText(EditText edit) {
20-
if (edit.getText() == null) {
21-
return "";
22-
}
23-
return edit.getText().toString();
20+
public static String getText(TextView textView) {
21+
return (textView != null) ? textView.getText().toString() : "";
2422
}
2523

2624
/**

0 commit comments

Comments
 (0)