Getting a error?

error :
attempt to invoke virtual method "java.lang.class java.lang.object.getclass()"on a null object reference.

please help me

if you already handle this error then answer me and if you not then i will some blocks

Simply you are trying to invoke something (method/property for example), on an Object(Componentetc…) that doesn’t exist.Null means nothing
If you show your blocks we can help you more find where exactly the problem is :wink:


here is my blocks

Those two blocks, have you created the component before trying to get it?


not working, BTW
yes i have created the component first then i calling lock.

here is the block

You have 120 Components.

But your Procedure Lock,
it’s for each number loop will try to Set Properties of Components till ID 121

As you are setting ID of get component to 1 + number,
in last loop when number will be 120,
ID will be set to 1 + 120 = 121

And no Component exsist with ID 121

Solution -
in for each number loop use
from 2
to 119
by 1

1 Like