Why does this code work but display an error message ingame?

ImmortalDreams
05 Mar 2012, 23:18
Edit: Thanks to anyone who checked this out, but I've decided to go with a modified version of Alex's ShowRoomDescription function. I like how it looks better. Thanks for creating the code, Alex. And thank you sgreig for posting it!
--
This code performs it's function ingame perfectly. When you type look at by itself, it executes the code of the description and enter attributes for player.parent.

<command>
<pattern>look at</pattern>
<script>
do (player.parent, "description")
do (player.parent, "enter")
</script>
</command>


This is the output for one of my jungle rooms:
> look at
Error running script: Object reference not set to an instance of an object.
You are in a jungle. It is covered with lush grasses and spongy green moss. The ground is covered with dense foliage. The trees are so tall and thick that you can't see the sky. Green tinted light filters past the numerous branches and down onto your surroundings.

A large wall of rock looms over you, preventing you from going certain directions.

Everything looks eerily similar except for a hive full of buzzing bees that blocks your way to the north.

Possible Directions:
south
west
southwest

Nearby Objects:
Bee Hive


Everything shows up properly except for the unwanted and apparently uneeded error message Error running script: Object reference not set to an instance of an object.

I'm still fairly new to Quest so I'm not sure what this means. Any advice on how to fix this would be greatly appreciated.