prevent null rooms a little bit

pull/1/head
Anton Franzluebbers 2024-02-22 16:01:08 -05:00
parent 89da691111
commit 703c29f2e9
2 changed files with 12 additions and 2 deletions

View File

@ -259,6 +259,15 @@ namespace VELConnect
{
state = JsonConvert.DeserializeObject<State>(json);
if (state == null) return;
if (state.room == null) {
state.room = new State.DataBlock
{
category = "room",
modified_by = "Unity",
data = null,
block_id = Application.productName + "_" + VelNetManager.Room
};
}
bool isInitialState = false;
@ -404,7 +413,7 @@ namespace VELConnect
}
// if (state.room.modified_by != DeviceId && state.room.data != null)
if (state.room?.data != null)
if (state.room.data != null)
{
foreach (KeyValuePair<string, string> elem in state.room.data)
{
@ -751,6 +760,7 @@ namespace VELConnect
State.DataBlock room = new State.DataBlock
{
category = "room",
modified_by = "Unity",
data = data
};

View File

@ -1,7 +1,7 @@
{
"name": "edu.uga.engr.vel.vel-connect",
"displayName": "VEL-Connect",
"version": "4.0.3",
"version": "4.0.4",
"unity": "2019.1",
"description": "Web-based configuration for VR applications",
"keywords": [],