Skip to content

Commit

Permalink
fix: run callback, default pass
Browse files Browse the repository at this point in the history
  • Loading branch information
xhyrom committed Aug 20, 2024
1 parent 6eed34d commit aad94b7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/main/java/digital/slovensko/autogram/core/Autogram.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ public void handleProtectedPdfDocument(ProtectedDSSDocument document) {
}

public void handleProtectedPdfDocument(ProtectedDSSDocument document, Runnable callback) {
if (!PDFUtils.isPdfAndPasswordProtected(document))
if (!PDFUtils.isPdfAndPasswordProtected(document)) {
callback.run();
return;
}

ui.onWorkThreadDo(() -> {
var password = ui.getDocumentPassword();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.io.File;

public class ProtectedFileDocument extends FileDocument implements ProtectedDSSDocument {
private char[] password;
private char[] password = new char[0];

public ProtectedFileDocument(String path) {
super(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.io.InputStream;

public class ProtectedInMemoryDocument extends InMemoryDocument implements ProtectedDSSDocument {
private char[] password;
private char[] password = new char[0];

public ProtectedInMemoryDocument(byte[] bytes) {
super(bytes);
Expand Down

0 comments on commit aad94b7

Please sign in to comment.