--- old/src/java.base/share/classes/sun/net/www/content/text/plain.java 2019-07-17 17:01:14.000000000 -0700 +++ new/src/java.base/share/classes/sun/net/www/content/text/plain.java 2019-07-17 17:01:14.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 1996, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,10 @@ public Object getContent(URLConnection uc) { try { InputStream is = uc.getInputStream(); - return new PlainTextInputStream(uc.getInputStream()); + if (is == null) { + is = InputStream.nullInputStream(); + } + return new PlainTextInputStream(is); } catch (IOException e) { return "Error reading document:\n" + e.toString(); }