Thanks, an upgrade is what I'll try.
We are on 7.2.1 and to make sure I said everything correct, the old template from a year or more ago works. It is the new template exported from 7.2.1 that my custom code tries to read that bombs.
If I use the exported template to create a site from Host | Site Management, it works. My code is a copy of the DNN Child Portal Creation code. Since it will work and allow users in certain roles to create portals, it should be fine on importing.
It seems to be a question of the code importing a template created on the 7.2.1 site.
Well, an upgrade, another export and we'll see what happens. If this does not work I probably need to review the current code which generates portals from Host | Site Management and find what's missing from my version.
Has the portal creation code changed significantly since about 6.5 or so? I'm not sure of the exact 6.x.x version where I copied the code from but if that's changed a lot then that may be the issue.
Thanks, Sebastian!