mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
Avoid ClassCastException when reading headers of EMF files
This commit is contained in:
parent
1594baf696
commit
e9e9612a1f
@ -81,6 +81,8 @@ public class HemfPicture implements Iterable<HemfRecord>, GenericRecord {
|
|||||||
List<HemfRecord> r = getRecords();
|
List<HemfRecord> r = getRecords();
|
||||||
if (r.isEmpty()) {
|
if (r.isEmpty()) {
|
||||||
throw new RecordFormatException("No records could be parsed - your .emf file is invalid");
|
throw new RecordFormatException("No records could be parsed - your .emf file is invalid");
|
||||||
|
} else if (!(r.get(0) instanceof HemfHeader)) {
|
||||||
|
throw new RecordFormatException("Could not convert object of type " + r.get(0).getClass() + " + - your .emf file is invalid");
|
||||||
} else {
|
} else {
|
||||||
return (HemfHeader)r.get(0);
|
return (HemfHeader)r.get(0);
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
test-data/slideshow/VHZ2NYFUYUUJNGLABL26ORTQZA76FJEW.emf
Executable file
BIN
test-data/slideshow/VHZ2NYFUYUUJNGLABL26ORTQZA76FJEW.emf
Executable file
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user