Skip to content

Commit c57067e

Browse files
committed
Merge pull request #242 from JLLeitschuh/fix/textAreaNullPointer
Fixes TextAreaSocketPreviewView NullPointer
2 parents e81267e + 89b9e47 commit c57067e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ui/src/main/java/edu/wpi/grip/ui/preview/TextAreaSocketPreviewView.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@
1414
public class TextAreaSocketPreviewView<T> extends SocketPreviewView<T> {
1515

1616
private final TextArea text;
17-
private GRIPPlatform platform;
17+
private final GRIPPlatform platform;
1818

1919
/**
20-
* @param socket An output socket to preview
20+
* @param socket An output socket to preview
2121
*/
2222
public TextAreaSocketPreviewView(GRIPPlatform platform, OutputSocket<T> socket) {
2323
super(socket);
24+
this.platform = platform;
2425

2526
this.setStyle("-fx-pref-width: 20em;");
2627

27-
this.text = new TextArea(socket.getValue().orElse((T)"").toString());
28+
this.text = new TextArea(socket.getValue().orElse((T) "").toString());
2829
text.setEditable(false);
2930

3031
this.setContent(text);
@@ -34,7 +35,7 @@ public TextAreaSocketPreviewView(GRIPPlatform platform, OutputSocket<T> socket)
3435
public void onSocketChanged(SocketChangedEvent event) {
3536
final Socket socket = event.getSocket();
3637
if (socket == this.getSocket()) {
37-
platform.runAsSoonAsPossible(() ->{
38+
platform.runAsSoonAsPossible(() -> {
3839
this.text.setText(socket.getValue().orElse("").toString());
3940
});
4041
}

0 commit comments

Comments
 (0)