# Null Pointer exception when saving the program

**URL:** <https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173>\
**Category:** Report a Bug\
**Created:** [May 13, 2024, 9:55am UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173 "2024-05-13T09:55:22Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthewmillar](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@matthewmillar](https://forum.universal-robots.com/u/matthewmillar)\
**Post date:** [May 13, 2024, 9:55am UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/1 "2024-05-13T09:55:22Z")

</div>

![IMG_2332](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/b/b09bf887b45c3cc15fb783b6f31d91240e43e3be.jpeg)

Any help with this? Very stuck

---

<div class="post-metadata">

**Author:** ![efn](https://avatars.discourse-cdn.com/v4/letter/e/35a633/32.png) [@efn](https://forum.universal-robots.com/u/efn)\
**Post date:** [May 13, 2024, 10:07am UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/2 "2024-05-13T10:07:21Z")

</div>

Are you running the latest version of PolyScope? Check version in upper right corner menu and About.  
Also, have you tried to redo the Pallet node? 🙂 Might help.

---

<div class="post-metadata">

**Author:** ![matthewmillar](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@matthewmillar](https://forum.universal-robots.com/u/matthewmillar)\
**Post date:** [May 13, 2024, 12:39pm UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/3 "2024-05-13T12:39:35Z")

</div>

Yes I’ve got the latest polyscope and re done the pallet node

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [May 13, 2024, 4:37pm UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/4 "2024-05-13T16:37:04Z")

</div>

Are you using subprograms in there? If so I’ll add your post to my list of others with the same problem.

> [@Palletizing in subprograms causes null pointers](https://forum.universal-robots.com/t/palletizing-in-subprograms-causes-null-pointers/30553):
>
> Steps to reproduce: Create a program with a Palletizing node. Put it in a subprogram. Reload the program. Get Nullpointers. Expected Behavior: Normal operation Actual Behavior: Palletizing node throws null pointers Workaround Suggestion: Can’t use Palletizing in subprograms Robot Serial Number: Various Affected Version(s): Unclear I’ve not personally had this problem, I’ve just seen it reported numerous times here on the forum with no response from UR. Please investigate this. @jbm …

---

<div class="post-metadata">

**Author:** ![matthewmillar](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@matthewmillar](https://forum.universal-robots.com/u/matthewmillar)\
**Post date:** [May 13, 2024, 7:07pm UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/5 "2024-05-13T19:07:59Z")

</div>

No sub programs, but two palletising setups. I was going to seperate them into sub programs but maybe not after what you’ve said.

---

<div class="post-metadata">

**Author:** ![jbaumgartner](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@jbaumgartner](https://forum.universal-robots.com/u/jbaumgartner)\
**Post date:** [August 29, 2024, 6:02pm UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/6 "2024-08-29T18:02:02Z")

</div>

I have this same issue just using 4 pallets in my program. The program will run fine have way through then the UR misses its palletized position. I put the UR back to its home position then that same Exception occurs. This is with 5.17 and all updated urcaps files. If anyone has any insight that would be great too.

---

<div class="post-metadata">

**Author:** ![pfrh](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@pfrh](https://forum.universal-robots.com/u/pfrh)\
**Post date:** [September 30, 2024, 9:22am UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/7 "2024-09-30T09:22:28Z")

</div>

SAME SAME here

Universal Robots, do you have a solution for this BIG problem?

---

<div class="post-metadata">

**Author:** ![efn](https://avatars.discourse-cdn.com/v4/letter/e/35a633/32.png) [@efn](https://forum.universal-robots.com/u/efn)\
**Post date:** [September 30, 2024, 9:43am UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/8 "2024-09-30T09:43:23Z")

</div>

Can you send a screenshot of your code? Or maybe the whole .urp program and .installation file? 🙂

---

<div class="post-metadata">

**Author:** ![pfrh](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@pfrh](https://forum.universal-robots.com/u/pfrh)\
**Post date:** [September 30, 2024, 11:49am UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/9 "2024-09-30T11:49:54Z")

</div>

Here is the program and installation files…

We have tried to make new pallets, so there may be more than normally…

Feel free to call me for further information.

(Attachment Metrology.installation is missing)

(Attachment Metrology.variables is missing)

(Attachment 290M510v2.txt is missing)

> **(attachments)**
>
> [290M510v2.script](https://forum.universal-robots.com/uploads/short-url/chmGOh4VoDkGS0J6dn50dn61vDz.script) (147 KB)  
> [290M510v2.urp](https://forum.universal-robots.com/uploads/short-url/leii2u3huLTQt3OVkNpVAHxAJlM.urp) (68 KB)

---

<div class="post-metadata">

**Author:** ![pfrh](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@pfrh](https://forum.universal-robots.com/u/pfrh)\
**Post date:** [September 30, 2024, 11:56am UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/10 "2024-09-30T11:56:20Z")

</div>

I´m not allowed to attach the other files…

---

<div class="post-metadata">

**Author:** ![efn](https://avatars.discourse-cdn.com/v4/letter/e/35a633/32.png) [@efn](https://forum.universal-robots.com/u/efn)\
**Post date:** [September 30, 2024, 12:24pm UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/11 "2024-09-30T12:24:53Z")

</div>

I can’t redo the error with just those files, but have you tried to identify/isolate the issue yourself?  
Like remove the script-calls within the Pallet node? 🙂

---

<div class="post-metadata">

**Author:** ![pfrh](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@pfrh](https://forum.universal-robots.com/u/pfrh)\
**Post date:** [October 1, 2024, 4:41am UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/12 "2024-10-01T04:41:46Z")

</div>

[New folder.zip](https://forum.universal-robots.com/uploads/short-url/fbcpXxnyDpFKakvtt4iyNFiUkoh.zip) (100.9 KB)  
I have tried to Zip the files…

We could see that the problem comes when we make a new pallet, with the same waypoints as the old pallet. If we move the robot up in Z and just make the four corners randomly then we don´t have the problem…

---

<div class="post-metadata">

**Author:** ![pfrh](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@pfrh](https://forum.universal-robots.com/u/pfrh)\
**Post date:** [October 4, 2024, 6:04am UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/13 "2024-10-04T06:04:04Z")

</div>

Hi  
What is the status?  
For info, it is all our robots that have/might have this issue…  
The robot that i sent you the program is standing still, and we need it up running asap…

---

<div class="post-metadata">

**Author:** ![matthewmillar](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@matthewmillar](https://forum.universal-robots.com/u/matthewmillar)\
**Post date:** [October 4, 2024, 8:06am UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/14 "2024-10-04T08:06:18Z")

</div>

I’ve found the work around for my specific problem, but it’s not really a solution. It needs fixing in the code with Universal Robots pallet node.

It only happens when the tcp is set to something else the pallet doesn’t use. So as long as the tcp is set correctly before progressing to the pallet node it works.

You could have a set tcp in before start so the program always starts with the correct starting tcp and then the pallet node is happy

Let me know if this works for you.

But a proper solution needs to be done by UR

---

<div class="post-metadata">

**Author:** ![cbennett](https://avatars.discourse-cdn.com/v4/letter/c/439d5e/32.png) [@cbennett](https://forum.universal-robots.com/u/cbennett)\
**Post date:** [January 20, 2025, 6:03pm UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/15 "2025-01-20T18:03:57Z")

</div>

I’ve been dealing with this same issue. We power the robot up and load the program we wish to run. When we hit the play button to start the program we get the same alarm even though the first line in the program is setting the TCP before start. To get around this we simply highlight the set command in the program and hit test, setting the appropriate TCP. Without a way around this issue, the robot must be left in manual, giving access to the program for the work around. Any advise?

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [January 20, 2025, 7:16pm UTC](https://forum.universal-robots.com/t/null-pointer-exception-when-saving-the-program/34173/16 "2025-01-20T19:16:55Z")

</div>

In my opinion, I’ve seen a lot of issues surrounding the pallet nodes. UR just has problems they aren’t addressing there. Unless you’re doing something really fancy with it, I would just write your own palletizing script. At the end of the day all you need to do is teach all your moves to a Feature and then shift that Feature in the direction you need it to go. You can use a combination of division (/) and modulo (%) to get which row and column of a “grid” or pallet you’d need to move to. Aside from doing it yourself you’ll likely be at the mercy of UR to fix the pallet node, and it’s been reported to be broken for quite a while now
