Sfoglia il codice sorgente

poll() bug fix.

write "Null" to Outbound object instead of empty String when the channel
is "Null".
lunar-mining 4 anni fa
parent
commit
33f299f8c6
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      bin/dnetview/src/main.rs

+ 3 - 1
bin/dnetview/src/main.rs

@@ -201,7 +201,9 @@ async fn poll(client: Map, model: Arc<Model>) -> Result<()> {
                 if slot["channel"].is_null() {
                 if slot["channel"].is_null() {
                     // channel is empty. initialize with empty values
                     // channel is empty. initialize with empty values
                     let state = &slot["state"];
                     let state = &slot["state"];
-                    let channel = Channel::new(String::new(), String::new());
+                    let msg = "Null".to_string();
+                    let status = "Null".to_string();
+                    let channel = Channel::new(msg, status);
                     let new_slot =
                     let new_slot =
                         Slot::new(String::new(), channel, state.as_str().unwrap().to_string());
                         Slot::new(String::new(), channel, state.as_str().unwrap().to_string());
                     slots.push(new_slot)
                     slots.push(new_slot)