changeset 13279:f7b36c518a5f

8144915: TextField throws NPE Reviewed-by: ssadetsky, serb
author arapte
date Wed, 09 Dec 2015 18:12:49 +0300
parents f96067ff0019
children 7b8890408366
files src/java.desktop/share/classes/java/awt/TextField.java
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/classes/java/awt/TextField.java	Tue Dec 08 19:50:14 2015 +0300
+++ b/src/java.desktop/share/classes/java/awt/TextField.java	Wed Dec 09 18:12:49 2015 +0300
@@ -309,6 +309,9 @@
      * @return      Returns text after replacing EOL characters.
      */
     private static String replaceEOL(String text) {
+        if (text == null) {
+            return text;
+        }
         String[] strEOLs = {System.lineSeparator(), "\n"};
         for (String eol : strEOLs) {
             if (text.contains(eol)) {