From dddaa125c047f3b0401dec885b3d65ce21d7c483 Mon Sep 17 00:00:00 2001 From: adam Date: Sat, 13 Feb 2021 22:35:07 +0200 Subject: fix --- php/database.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/php/database.php b/php/database.php index 42ff7c1..c8904db 100644 --- a/php/database.php +++ b/php/database.php @@ -107,7 +107,13 @@ require_once "node.php"; return NULL; } $ret= $statement->fetch(PDO::FETCH_ASSOC); - return $ret["id"]; + if(isset($ret["id"])) + { + return $ret["id"]; + }else + { + return NULL; + } } /* I think this only makes sense if node is a dir*/ /* returns assoc array of nodes*/ @@ -348,7 +354,7 @@ require_once "node.php"; /*give premissions*/ $id=$this->get_node_with_code($code_name); - if($id!=NULL) + if($id==NULL) { error_log("created a dangling directory but couldn't find it afterward. Fatal error!"); exit(1); -- cgit v1.2.3