Skip to content

Commit 7384c44

Browse files
committed
Patch fix for failing to publish datasets without file PIDs: IQSS#11596 fix compare separator logic
1 parent 5e9e61a commit 7384c44

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/edu/harvard/iq/dataverse/pidproviders/AbstractPidProvider.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,19 @@ public DvObject generatePid(DvObject dvObject) {
209209
if (dvObject.getSeparator() == null) {
210210
dvObject.setSeparator(getSeparator());
211211
} else {
212-
if (!dvObject.getSeparator().equals(getSeparator())) {
212+
//only check separator if identifier is not null because a null authority would be set above...
213+
//SEK 06/26/25 #11546
214+
if (dvObject.getIdentifier() != null
215+
&& !dvObject.getSeparator().equals(getSeparator())) {
213216
logger.warning("The separator of the DvObject (" + dvObject.getSeparator()
214217
+ ") does not match the configured separator (" + getSeparator() + ")");
215218
throw new IllegalArgumentException("The separator of the DvObject (" + dvObject.getSeparator()
216219
+ ") doesn't match that of the provider, id: " + getId());
220+
} else {
221+
//we know it's not null so fill it if it's empty
222+
if (dvObject.getSeparator().isEmpty()) {
223+
dvObject.setSeparator(getSeparator());
224+
}
217225
}
218226
}
219227
if (dvObject.isInstanceofDataset()) {

0 commit comments

Comments
 (0)