Skip to content

Commit

Permalink
Merge pull request #2878 from wordpress-mobile/issue/2860-npe-post-se…
Browse files Browse the repository at this point in the history
…ttings-update

Fixing #2860 - potential NPEs when updating a post object
  • Loading branch information
maxme committed Jun 19, 2015
2 parents 2ee9d3e + 349ced2 commit 17c4c41
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.text.TextUtils;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;

/**
* EditText utils
Expand All @@ -14,13 +15,10 @@ private EditTextUtils() {
}

/**
* returns text string from passed EditText
* returns non-null text string from passed TextView
*/
public static String getText(EditText edit) {
if (edit.getText() == null) {
return "";
}
return edit.getText().toString();
public static String getText(TextView textView) {
return (textView != null) ? textView.getText().toString() : "";
}

/**
Expand Down

0 comments on commit 17c4c41

Please sign in to comment.