Skip to content

Commit

Permalink
Correctly handle unloading proofs
Browse files Browse the repository at this point in the history
  • Loading branch information
FliegendeWurst authored and wadoon committed Feb 4, 2023
1 parent 41f5b53 commit 16e768e
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ public JavacExtension() {

private void loadProof(Proof selectedProof) throws RuntimeException {
try {
JavacData data = selectedProof.getUserData().get(JavacData.class);
updateLabel(data);
if (selectedProof != null) {
JavacData data = selectedProof.getUserData().get(JavacData.class);
updateLabel(data);
} else {
updateLabel(null);
}
} catch (IllegalStateException e) {
JavacData data = new JavacData();
selectedProof.getUserData().register(data);
Expand Down Expand Up @@ -165,8 +169,13 @@ private void loadProof(Proof selectedProof) throws RuntimeException {
* @param data data to use
*/
private void updateLabel(JavacData data) {
if (data == null)
if (data == null) {
lblStatus.setText("Javac");
lblStatus.setIcon(null);
lblStatus.setForeground(Color.BLACK);
lblStatus.setEnabled(false);
return;
}
if (data.nonJavaProof) {
lblStatus.setText("No Java");
lblStatus.setIcon(null);
Expand Down

0 comments on commit 16e768e

Please sign in to comment.