mirror of https://github.com/apache/poi.git
fixed NPE in HyperlinkRecord.toString()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@720997 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7c56a08816
commit
65d9d900b9
|
@ -628,7 +628,7 @@ public final class HyperlinkRecord extends StandardRecord {
|
|||
if ((_linkOpts & HLINK_TARGET_FRAME) != 0) {
|
||||
buffer.append(" .targetFrame= ").append(getTargetFrame()).append("\n");
|
||||
}
|
||||
if((_linkOpts & HLINK_URL) != 0) {
|
||||
if((_linkOpts & HLINK_URL) != 0 && _moniker != null) {
|
||||
buffer.append(" .moniker = ").append(_moniker.formatAsString()).append("\n");
|
||||
}
|
||||
if ((_linkOpts & HLINK_PLACE) != 0) {
|
||||
|
|
|
@ -435,6 +435,11 @@ public final class TestHyperlinkRecord extends TestCase {
|
|||
HyperlinkRecord hr = new HyperlinkRecord(in);
|
||||
byte[] ser = hr.serialize();
|
||||
TestcaseRecordInputStream.confirmRecordEncoding(HyperlinkRecord.sid, dataUNC, ser);
|
||||
try {
|
||||
hr.toString();
|
||||
} catch (NullPointerException e) {
|
||||
throw new AssertionFailedError("Identified bug with option URL and UNC set at same time");
|
||||
}
|
||||
}
|
||||
|
||||
public void testGUID() {
|
||||
|
|
Loading…
Reference in New Issue