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

NullPointer behoben

parent de9ba158
No related branches found
No related tags found
No related merge requests found
......@@ -505,16 +505,21 @@ public class GuiController {
* sowie den Klartext in das Textfeld tfKlartext. Setzt den Spruchschlüssel
*/
private void empfangeFunkspruch() {
progressDialogue("rx");
if (this.empfangeneNachricht[2] != null) {
setzeTagesSchluessel();
tfKlartext.setText(this.empfangeneNachricht[2]);
tfCodiert.setText(this.empfangeneNachricht[1]);
resetDisplay = true;
try {
if (this.empfangeneNachricht[2] != null && this.empfangeneNachricht[1] != null) {
setzeTagesSchluessel();
tfKlartext.setText(this.empfangeneNachricht[2]);
tfCodiert.setText(this.empfangeneNachricht[1]);
resetDisplay = true;
// Spruchschluessel in das Feld lblSpruchschluessel schreiben
lblSpruchschluessel.setText(codierer.empfangenerSpruchschluessel(this.empfangeneNachricht[2]));
// Spruchschluessel in das Feld lblSpruchschluessel schreiben
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 {
* Löscht die Textfelder tfKlartext und tfCodiert
*/
private void sendeFunkspruch() {
this.tfKlartext.setText("");
this.tfCodiert.setText("");
......@@ -530,6 +536,7 @@ public class GuiController {
}
private void progressDialogue(String strRxTx) {
Task copyWorker = createWorker(strRxTx);
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