about summary refs log tree commit diff
path: root/sourcecodes/modified_network.php
diff options
context:
space:
mode:
Diffstat (limited to 'sourcecodes/modified_network.php')
-rw-r--r--sourcecodes/modified_network.php30
1 files changed, 16 insertions, 14 deletions
diff --git a/sourcecodes/modified_network.php b/sourcecodes/modified_network.php
index 9f38335c..3be0d69c 100644
--- a/sourcecodes/modified_network.php
+++ b/sourcecodes/modified_network.php
@@ -31,20 +31,22 @@ if($_POST["My_key"]!="")
 $filename = "/tmp/bnw/".$old_key."modify_edge.txt";
 
 $file = fopen($filename,'w');
-//fwrite($file,$json);
-fwrite($file,$nnodes);
-fwrite($file,"\n");
-fwrite($file,$node_labs);
-fwrite($file,"\n");
-fwrite($file,$nedges);
-fwrite($file,"\n");
-fwrite($file,$sources);
-fwrite($file,"\n");
-fwrite($file,$targets);
-fwrite($file,"\n");
-fwrite($file,$weights);
-fwrite($file,"\n");
-fclose($file);
+if ($file !== false) {
+  //fwrite($file,$json);
+  fwrite($file,$nnodes);
+  fwrite($file,"\n");
+  fwrite($file,$node_labs);
+  fwrite($file,"\n");
+  fwrite($file,$nedges);
+  fwrite($file,"\n");
+  fwrite($file,$sources);
+  fwrite($file,"\n");
+  fwrite($file,$targets);
+  fwrite($file,"\n");
+  fwrite($file,$weights);
+  fwrite($file,"\n");
+  fclose($file);
+}
 
 shell_exec('./run_scripts/run_mod_edges '.$old_key.' '.$keyval);