Bug 726402

Summary: Systems->Registered->Environments - nil object error generated when there are no systems
Product: Red Hat Satellite Reporter: Brad Buckingham <bbuckingham>
Component: WebUIAssignee: Shannon Hughes <shughes>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: sghai, shughes
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-22 17:50:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 747354    

Description Brad Buckingham 2011-07-28 13:54:59 UTC
Description of problem:

When accessing the Systems->Registered->Environments, if there are no systems registered an error notice is displayed indicating a nil object was encountered.  

Version-Release number of selected component (if applicable):
git master

How reproducible:
always

Steps to Reproduce:
1. clear-all.sh (to clear the systems)
2. script/rails s
3. go to Systems->Registered->Environments
  
Actual results:
Page loads and following error notice is generated:

You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.first

Expected results:
Page loads and not error notice is generated (i.e. we should internally handle the nil).

Additional info:

Comment 1 Sachin Ghai 2011-08-19 12:19:19 UTC
Verified this with following build:
root@dhcp201-207 katello]# rpm -qa | grep katello
katello-cli-0.1.4-1.git.63.54683c2.fc15.noarch
katello-0.1.64-1.git.0.0b431ff.fc15.noarch

I verified this on freshly installed system, no error is reproducible under 
Systems->Registered->Environments.

To confirm this, I registered a system from cli and then unregistered it. And checked the Systems->Registered->Environments from webUI. Again the reported error is no longer reproducible.