# Palletizing in subprograms causes null pointers

**URL:** <https://forum.universal-robots.com/t/palletizing-in-subprograms-causes-null-pointers/30553>\
**Category:** Report a Bug\
**Created:** [September 22, 2023, 3:41pm UTC](https://forum.universal-robots.com/t/palletizing-in-subprograms-causes-null-pointers/30553 "2023-09-22T15:41:23Z")\
**Posts on this page:** 5\
**Page:** 1

<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:** [September 22, 2023, 3:41pm UTC](https://forum.universal-robots.com/t/palletizing-in-subprograms-causes-null-pointers/30553/1 "2023-09-22T15:41:23Z")

</div>

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

> [@Java Null Pointer Error on Palletizing Node After Restart](https://forum.universal-robots.com/t/java-null-pointer-error-on-palletizing-node-after-restart/17547):
>
> Hi, I’m having a strange problem where every time my robot (ur10e) gets rebooted or is otherwise turned off and turned back on (not estop) I lose my palletizing node and get the following null pointer error: The pallet and pattern were named unique names, but upon startup they have generic names. This happens even when no actions are put under “tool action”. Any help with this would be greatly appreciated since simply keeping the robot powered on for its ent…

> [@Palletizing subprogram gives error when clicked on 'Keep subprogram updated'](https://forum.universal-robots.com/t/palletizing-subprogram-gives-error-when-clicked-on-keep-subprogram-updated/17583):
>
> Hello everyone, I am currently facing a problem with subprogram. When I click on ‘Keep Subprogram File Updated With this Program’ and then save and close the main program. And again when I open the main program. It shows yellow nodes with that subprogram. This error is ONLY happening with the subprograms which involve palletizing. And when I try to run the program it shows the error as shown in the image attached. I have not been able to understand why is this happening. Please help me out. Th…

> [@Error message in palletizing wizard after opening a new program](https://forum.universal-robots.com/t/error-message-in-palletizing-wizard-after-opening-a-new-program/28851/2):
>
> I’ve seen this a few other times by people reporting this, and it seems they are always using subprograms as well. It’s a bug on UR’s end, unfortunately, and there won’t be anything you can do to fix it beyond what you’ve done by reporting it. You could try workarounds like rebooting the robot or something.

> [@Error after restart (java.lang.NullPointerException)](https://forum.universal-robots.com/t/error-after-restart-java-lang-nullpointerexception/30497):
>
> Hello, I had a program running for the last few days. Now I had some Problems with the Visor program (Send change job request failed). I rebooted the UR10, but now the program that worked the last few days isn’t starting anymore. I now get a error message and can’t start the program… Is there anything I can do? This was the error why I restarted the UR This is the error message I get now

> [@Palletizing in Subroutine - NullPointerException](https://forum.universal-robots.com/t/palletizing-in-subroutine-nullpointerexception/25450):
>
> When using the palletizing function in a subroutine, everything works as expected until you close and reopen the program. This includes restarting the controller. After reopening the file, variables relating to the palletizing template are automatically renamed. This causes NullPointerException errors and a total breakdown of the palletizing function, and I have not been able to recover by reassigning the original variables… the only way to fix is to delete the palletizing node and add/configur…

---

<div class="post-metadata">

**Author:** ![michael.bender](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@michael.bender](https://forum.universal-robots.com/u/michael.bender)\
**Post date:** [September 26, 2023, 7:08pm UTC](https://forum.universal-robots.com/t/palletizing-in-subprograms-causes-null-pointers/30553/2 "2023-09-26T19:08:24Z")

</div>

> [@How to prevent renaming variables when using Subprog?](https://forum.universal-robots.com/t/how-to-prevent-renaming-variables-when-using-subprog/16967):
>
> Hello, How can I prevent Polyscope from asking me to rename variables when using “Subprog”? Some context: I made a program which I use for machine tending. It runs well, only I want to split the program into two programs. A part specific program and a generic program. From the generic program there will be 1 version and from the part specific program I can have as many as I want. This allows me to easily deploy a change in the generic program without going through all the part specific progra…

---

<div class="post-metadata">

**Author:** ![zachary.wallace](https://avatars.discourse-cdn.com/v4/letter/z/eb9ed0/32.png) [@zachary.wallace](https://forum.universal-robots.com/u/zachary.wallace)\
**Post date:** [September 26, 2023, 8:58pm UTC](https://forum.universal-robots.com/t/palletizing-in-subprograms-causes-null-pointers/30553/3 "2023-09-26T20:58:25Z")

</div>

I use palletizing in sub programs. I have gotten that same error along with other issues doing so, but the workaround for me was to uncheck the “Save sub with this file” box in the sub prog, open sub, then open back up the main program. Hope this helps somebody out.

---

<div class="post-metadata">

**Author:** ![federico.piconi](https://avatars.discourse-cdn.com/v4/letter/f/439d5e/32.png) [@federico.piconi](https://forum.universal-robots.com/u/federico.piconi)\
**Post date:** [February 29, 2024, 7:19am UTC](https://forum.universal-robots.com/t/palletizing-in-subprograms-causes-null-pointers/30553/4 "2024-02-29T07:19:39Z")

</div>

Hello, I had the same problem.

I solved it by creating **installation variables** in Installation → Variables.

By replacing these variables both in the main program and in the subprogram, the warning no longer appears.

---

<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:** [March 24, 2026, 1:35pm UTC](https://forum.universal-robots.com/t/palletizing-in-subprograms-causes-null-pointers/30553/5 "2026-03-24T13:35:06Z")

</div>

Another report years later: [NullPointerException Error](https://forum.universal-robots.com/t/nullpointerexception-error/42495)
