Преглед на файлове

poll() bug fix.

write "Null" to Outbound object instead of empty String when the channel
is "Null".
lunar-mining преди 4 години
родител
ревизия
33f299f8c6
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  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() {
                     // channel is empty. initialize with empty values
                     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 =
                         Slot::new(String::new(), channel, state.as_str().unwrap().to_string());
                     slots.push(new_slot)