Skip to content

Commit

Permalink
fixed null pointer error
Browse files Browse the repository at this point in the history
  • Loading branch information
Endrit-Smajli committed Apr 30, 2024
1 parent 6e29b4b commit 375857f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main/java/uta/cse3310/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class Main extends WebSocketServer {

public Main(int port){
super(new InetSocketAddress(port));

wordBankList = new ArrayList<>();
}

//Ran when a new websocket connection is completed.
Expand Down Expand Up @@ -229,7 +229,9 @@ public void onMessage(WebSocket conn, String message) {


public List<String> wordBankList; //Keep this for now for the method that displays the words
/*



public void wordBank(){
wordBankList = new ArrayList<>();
}
Expand All @@ -250,7 +252,9 @@ public void fillWordBank(List<Words> usedWordList){
}

}
*/



public void displayWordsInBank(){
JSONObject words = new JSONObject();
JSONArray wordsArray = new JSONArray();
Expand All @@ -266,6 +270,8 @@ public void displayWordsInBank(){
broadcast(jsonBank);
}



public void handleChatMessage(UserMsg userMsg) {
// Construct JSON object representing the chat message
JSONObject chatMessage = new JSONObject();
Expand Down

0 comments on commit 375857f

Please sign in to comment.