NullReferenceException Guys I cant find the where is the mistake

public var stars: int;
This is my first code in the CardDatabase gameobject. And i gave the variables in inspector.

This is another code with name carddatabase:

var database : GameObject;
var i : int;
function Start(){
	i = database.carddatabase.stars[1];

And ı chose the CardDatabase gameobject for database variable in inspector.
But when i started taking this error: NullReferenceException : Object Reference not set to an instance of an object.
Guys i searched another topics but i couldnt solve. Not much very english. Thanks guys.

I solved it with GetComponent , Thanks Guys :smiley: