Skip to content

Commit

Permalink
Fix media clip exception
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximPlusov committed Apr 9, 2024
1 parent 31e32ee commit 783db2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public String getAlt() {
@Override
public Boolean gethasCorrectAlt() {
COSObject object = simplePDObject.getKey(ASAtom.ALT);
if (object.getType() != COSObjType.COS_ARRAY) {
if (object == null || object.getType() != COSObjType.COS_ARRAY) {
return false;
}
COSArray array = (COSArray)object.getDirectBase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
package org.verapdf.gf.model.impl.pd.actions;

import org.verapdf.as.ASAtom;
import org.verapdf.cos.COSObjType;
import org.verapdf.cos.COSObject;
import org.verapdf.model.baselayer.Object;
import org.verapdf.model.pdlayer.PDMediaClip;
Expand Down Expand Up @@ -58,7 +59,7 @@ private List<PDMediaClip> getC() {
COSObject object = ((PDAction) this.simplePDObject).getRendition();
if (object != null) {
object = object.getKey(ASAtom.C);
if (object != null) {
if (object != null && object.getType() == COSObjType.COS_DICT) {
List<PDMediaClip> list = new ArrayList<>(MAX_NUMBER_OF_ELEMENTS);
list.add(new GFPDMediaClip(new org.verapdf.pd.actions.PDMediaClip(object)));
return Collections.unmodifiableList(list);
Expand Down

0 comments on commit 783db2f

Please sign in to comment.