mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8228338: tools/pack200/TimeStamp.java fails with NullPointerException
Reviewed-by: lancea
This commit is contained in:
parent
fc0b8141d3
commit
9b23ca4eb4
2 changed files with 9 additions and 4 deletions
|
@ -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 class plain extends ContentHandler {
|
|||
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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue