Skip to content

Commit 4221e12

Browse files
committed
DefaultIOService: skip event when nothing saved
If no saver was found, we should not broadcast a DataSavedEvent. Doing so is inconsistent with the open method, which only publishes a DataOpenedEvent when non-null data was actually opened successfully.
1 parent 40d2ae4 commit 4221e12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/scijava/io/DefaultIOService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ public void save(final Object data, final String destination)
9999
final IOPlugin<Object> saver = getSaver(data, destination);
100100
if (saver != null) {
101101
saver.save(data, destination);
102+
eventService.publish(new DataSavedEvent(destination, data));
102103
}
103-
eventService.publish(new DataSavedEvent(destination, data));
104104
}
105105

106106
// -- HandlerService methods --

0 commit comments

Comments
 (0)