From e8fe170babc9544ccf8f2f8daa52933dddbb9b5b Mon Sep 17 00:00:00 2001
From: hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c>
Date: Sat, 24 Oct 2009 17:20:21 +0000
Subject: work with rockspecs with no dependencies

git-svn-id: http://luarocks.org/svn/luarocks/trunk@110 9ca3f7c1-7366-0410-b1a3-b5c78f85698c
---
 src/luarocks/loader.lua | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'src')

diff --git a/src/luarocks/loader.lua b/src/luarocks/loader.lua
index 22a5a8df..3d421632 100644
--- a/src/luarocks/loader.lua
+++ b/src/luarocks/loader.lua
@@ -56,9 +56,12 @@ function add_context(name, version)
    for _, tree in pairs(rocks_trees) do
       local manifest = tree.manifest
 
-      local pkgdeps = manifest.dependencies and manifest.dependencies[name][version]
+      local pkgdeps
+      if manifest.dependencies and manifest.dependencies[name] then
+         pkgdeps = manifest.dependencies[name][version]
+      end
       if not pkgdeps then
-         return
+         return nil
       end
       for _, dep in ipairs(pkgdeps) do
          local package, constraints = dep.name, dep.constraints
-- 
cgit v1.2.3-55-g6feb