diff --git a/module/testcase/view/caseheader.html.php b/module/testcase/view/caseheader.html.php
index ce644b851a..f9ced8b071 100644
--- a/module/testcase/view/caseheader.html.php
+++ b/module/testcase/view/caseheader.html.php
@@ -44,8 +44,10 @@
diff --git a/module/tree/model.php b/module/tree/model.php
index 64c154a8c2..bc6e1c340b 100644
--- a/module/tree/model.php
+++ b/module/tree/model.php
@@ -246,8 +246,19 @@ class treeModel extends model
{
$treeMenu = array();
$stmt = $this->dbh->query($this->buildMenuQuery($rootID, $type, $startModule));
+
+ /* Add for task #1945. check the module has case or no. */
+ if($type == 'case' and !empty($extra)) $this->loadModel('testtask');
while($module = $stmt->fetch())
{
+ /* Add for task #1945. check the module has case or no. */
+ if($type == 'case' and !empty($extra))
+ {
+ $modules = $this->getAllChildID($module->id);
+ $runs = $this->testtask->getRuns($extra, $modules, 'id');
+ if(empty($runs)) continue;
+ }
+
$linkHtml = call_user_func($userFunc, $type, $module, $extra);
if(isset($treeMenu[$module->id]) and !empty($treeMenu[$module->id]))