diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php
index c1fb483dd2e9de5e495d8590735c85ef5486dc4a..a1581bb6228da8b60c64c7f4f14f1ca292284f2b 100644
--- a/vtlib/Vtiger/Functions.php
+++ b/vtlib/Vtiger/Functions.php
@@ -1571,12 +1571,10 @@ class Vtiger_Functions {
             $query = "SELECT attachmentsid FROM vtiger_seattachmentsrel WHERE crmid = ?";
             $result = $adb->pquery($query, array($crmid));
             $noofrows = $adb->num_rows($result);
-            if ($noofrows > 1) {
+            if ($noofrows) {
                 for ($i = 0; $i < $noofrows; $i++) {
                     $attachmentIds[] = vtws_getId($WsEntityId,$adb->query_result($result, $i, 'attachmentsid'));
                 }
-            } else if($noofrows > 0){
-                $attachmentIds[] = vtws_getId($WsEntityId, $adb->query_result($result, 0, 'attachmentsid'));
             }
         }
         return $attachmentIds;