Docs app: "You cannot call a method on a null-valued expression" at index.ps1 line 555 ($PSUBasePath is null)
Hi Support,
i found a small bug in the integration documentation app:
Version: PowerShell Universal 2026.2.5, Linux (container, Rocky Linux base), no base path configured.
What happens: On every server start the built-in Docs app logs two errors: You cannot call a method on a null-valued expression. / at ScriptBlock, /opt/universal/Docs/index.ps1: line 555
Cause: line 555 renders the "Powered by Devolutions" navigation item with $($PSUBasePath.TrimEnd('/')) for the light and the dark logo. $PSUBasePath is $null when no base path is configured, so TrimEnd is called on $null - one error per logo.
Suggested fix: guard the call, e.g. $("$PSUBasePath".TrimEnd('/')) or $(if ($PSUBasePath) { $PSUBasePath.TrimEnd('/') }).
Expected: no errors when no base path is set; the logo URLs fall back to the root.
Thanks
René
Hello @Mordecai
Thank you for the detailed report and for identifying the specific condition around $PSUBasePath.
The information you provided is enough for us to investigate this without asking you to repeat additional environment details. We will review the behavior in PowerShell Universal 2026.2.5 and validate the scenario where no base path is configured, including the TrimEnd() call in the Docs app.
We will update the thread once we have confirmed the behavior and determined the appropriate next step.
Best regards,
Ruben Tapia
Hello René,
Thank you for the detailed report. Following up on Ruben's reply, I checked the 2026.2.5 source: line 555 of Docs/index.ps1 builds the "Powered by Devolutions" item with $($PSUBasePath.TrimEnd('/')) for both the light and the dark logo, as you describe. The same call is still in 2026.3.3 (line 559).
I could not reproduce the errors in my lab. I started a 2026.2.5 container with no base path set: the built-in Docs app started with no "null-valued expression" error in its logs, and $PSUBasePath was an empty string, not null, in an app run the same way. A copy of the Docs app also started without error, and 2026.3.3 behaved the same. My container used the Ubuntu-based image, not your Rocky Linux one, and I did not open the Docs app in a browser.
Could you paste the first error with the lines around it from the Docs app log (Logs/User/log<date>.txt, or wherever you see it), and the PSU system-log lines (Logs/System/systemLog<date>.txt) from the same time? They may help us identify what happened just before the error.
Best regards,
Michel
Michel Audi