[FIX] NullPointerException nach Start ohne Items in der Liste

This commit is contained in:
da
2015-11-30 21:55:54 +01:00
parent da7301e374
commit b3c79235ed
4 changed files with 7 additions and 4 deletions
@@ -1,5 +1,6 @@
package com.ixab.ConfigHandling; package com.ixab.ConfigHandling;
import com.ixab.Logging.Logger;
import com.ixab.StreamHandling.StreamInfo; import com.ixab.StreamHandling.StreamInfo;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
@@ -32,6 +33,7 @@ public class StreamConfigItem implements Serializable {
this.category = StreamInfo.getGame(); this.category = StreamInfo.getGame();
} }
public void refreshInfo() { public void refreshInfo() {
Logger.print("Refreshing stream data for " + this.name, this);
this.getInfo(); this.getInfo();
} }
+2 -1
View File
@@ -6,6 +6,7 @@ import com.ixab.ConfigHandling.StreamConfigItem;
import com.ixab.ConfigHandling.StreamConfigSorter; import com.ixab.ConfigHandling.StreamConfigSorter;
import com.ixab.Logging.Logger; import com.ixab.Logging.Logger;
import com.ixab.StreamHandling.StreamOpener; import com.ixab.StreamHandling.StreamOpener;
import javafx.event.EventDispatcher;
import javax.swing.*; import javax.swing.*;
import java.awt.event.*; import java.awt.event.*;
@@ -202,7 +203,7 @@ public class MainWindow {
} }
if (o != null) { if (o != null) {
comboBoxStreams.setSelectedItem(o); comboBoxStreams.setSelectedItem(o);
} else { } else if (comboBoxStreams.getItemCount()>0) {
comboBoxStreams.setSelectedIndex(0); comboBoxStreams.setSelectedIndex(0);
} }
} }
+2 -2
View File
@@ -65,12 +65,12 @@
<text value="Pfad zu Livestreamer:"/> <text value="Pfad zu Livestreamer:"/>
</properties> </properties>
</component> </component>
<component id="42a4f" class="javax.swing.JCheckBox" binding="debugmodusCheckBox" default-binding="true"> <component id="42a4f" class="javax.swing.JCheckBox" binding="nichtImplementiertCheckBox" default-binding="true">
<constraints> <constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/> <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints> </constraints>
<properties> <properties>
<text value=""/> <text value=" (nicht implementiert)"/>
</properties> </properties>
</component> </component>
<component id="e34b3" class="javax.swing.JLabel"> <component id="e34b3" class="javax.swing.JLabel">
+1 -1
View File
@@ -11,7 +11,7 @@ public class SettingsWindow extends JDialog {
private JPanel contentPane; private JPanel contentPane;
private JButton buttonOK; private JButton buttonOK;
private JButton buttonCancel; private JButton buttonCancel;
private JCheckBox debugmodusCheckBox; private JCheckBox nichtImplementiertCheckBox;
private JTextField textField1; private JTextField textField1;
private JButton suchenButton; private JButton suchenButton;
private JTextField twitchBenutzernameTextField; private JTextField twitchBenutzernameTextField;