Project

General

Profile

« Previous | Next » 

Revision 43239

avoid NPE

View differences:

modules/dnet-openaire-domain/trunk/src/main/java/eu/dnetlib/data/actionmanager/actions/AtomicActionSerialiser.java
64 64

  
65 65
	private String getTargetValueJSON(final AtomicAction aa) {
66 66
		try {
67
			final Oaf oaf = Oaf.parseFrom(aa.getTargetValue());
68
			return aa.getTargetValue() != null && aa.getTargetValue().length > 0 ? JsonFormat.printToString(oaf) : "";
67
			return aa.getTargetValue() != null && aa.getTargetValue().length > 0 ? JsonFormat.printToString(Oaf.parseFrom(aa.getTargetValue())) : "";
69 68
		} catch (InvalidProtocolBufferException e) {
70 69
			log.error("unable to parse proto", e);
71 70
			return null;

Also available in: Unified diff