Skip to content
Snippets Groups Projects
Commit 03689f5d authored by Dennis Eisold's avatar Dennis Eisold
Browse files

Merge branch 'master' into 'master'

NullPointer behoben

See merge request alfatrainingkurse/java/enigma!103
parents 4c1cffd1 cee38f95
No related branches found
No related tags found
No related merge requests found
...@@ -505,16 +505,21 @@ public class GuiController { ...@@ -505,16 +505,21 @@ public class GuiController {
* sowie den Klartext in das Textfeld tfKlartext. Setzt den Spruchschlüssel * sowie den Klartext in das Textfeld tfKlartext. Setzt den Spruchschlüssel
*/ */
private void empfangeFunkspruch() { private void empfangeFunkspruch() {
progressDialogue("rx"); progressDialogue("rx");
if (this.empfangeneNachricht[2] != null) { try {
setzeTagesSchluessel(); if (this.empfangeneNachricht[2] != null && this.empfangeneNachricht[1] != null) {
tfKlartext.setText(this.empfangeneNachricht[2]); setzeTagesSchluessel();
tfCodiert.setText(this.empfangeneNachricht[1]); tfKlartext.setText(this.empfangeneNachricht[2]);
resetDisplay = true; tfCodiert.setText(this.empfangeneNachricht[1]);
resetDisplay = true;
// Spruchschluessel in das Feld lblSpruchschluessel schreiben // Spruchschluessel in das Feld lblSpruchschluessel schreiben
lblSpruchschluessel.setText(codierer.empfangenerSpruchschluessel(this.empfangeneNachricht[2])); lblSpruchschluessel.setText(codierer.empfangenerSpruchschluessel(this.empfangeneNachricht[2]));
}
} catch(NullPointerException ignored) {
new Fehler().showErrorDialog("warning", "Aus dem Westen nichts neues", "Keine neuen Nachrichten vorhanden");
} }
} }
...@@ -523,6 +528,7 @@ public class GuiController { ...@@ -523,6 +528,7 @@ public class GuiController {
* Löscht die Textfelder tfKlartext und tfCodiert * Löscht die Textfelder tfKlartext und tfCodiert
*/ */
private void sendeFunkspruch() { private void sendeFunkspruch() {
this.tfKlartext.setText(""); this.tfKlartext.setText("");
this.tfCodiert.setText(""); this.tfCodiert.setText("");
...@@ -530,6 +536,7 @@ public class GuiController { ...@@ -530,6 +536,7 @@ public class GuiController {
} }
private void progressDialogue(String strRxTx) { private void progressDialogue(String strRxTx) {
Task copyWorker = createWorker(strRxTx); Task copyWorker = createWorker(strRxTx);
ProgressDialog dialog = new ProgressDialog(copyWorker); ProgressDialog dialog = new ProgressDialog(copyWorker);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment