diff --git a/lib/puppet/resource_api.rb b/lib/puppet/resource_api.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/resource_api.rb
+++ b/lib/puppet/resource_api.rb
@@ -303,7 +303,7 @@ module Puppet::ResourceApi
 
       define_method(:namevar_match?) do |item|
         context.type.namevars.all? do |namevar|
-          item[namevar] == @parameters[namevar].value
+          item[namevar] == @parameters[namevar].value if @parameters[namevar].respond_to? :value
         end
       end
 
diff --git a/spec/acceptance/namevar_spec.rb b/spec/acceptance/namevar_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/acceptance/namevar_spec.rb
+++ b/spec/acceptance/namevar_spec.rb
@@ -95,6 +95,13 @@ RSpec.describe 'a type with multiple namevars' do
       it { expect(@status.exitstatus).to eq 0 }
     end
 
+    context 'when requesting a resource that does not exist, without all namevars' do
+      let(:manifest) { 'multiple_namevar { foo: }' }
+
+      it { expect(@stdout_str).to match %r{Multiple_namevar\[foo\]/ensure: defined 'ensure' as 'present'} }
+      it { expect(@status.exitstatus).to eq 2 }
+    end
+
     context 'when removing a previously present instance' do
       let(:manifest) { 'multiple_namevar { foo: package => php, manager => yum, ensure => absent }' }
Add check to handle absent resources through puppet apply