# Handling empty RED.settings.ui in UI node

**URL:** <https://discourse.nodered.org/t/handling-empty-red-settings-ui-in-ui-node/38812>\
**Category:** Share Your Nodes\
**Created:** [8 January 2021 20:44 UTC](https://discourse.nodered.org/t/handling-empty-red-settings-ui-in-ui-node/38812 "2021-01-08T20:44:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [8 January 2021 20:44 UTC](https://discourse.nodered.org/t/handling-empty-red-settings-ui-in-ui-node/38812/1 "2021-01-08T20:44:49Z")

</div>

Hi folks,

In all my UI nodes I use the following code snippet to calculate the ui path of my endpoints:

```auto
// By default the UI path in the settings.js file will be in comment:
// //ui: { path: "ui" },
// But as soon as the user has specified a custom UI path there, we will need to use that path:
// ui: { path: "mypath" },
var uiPath = ((RED.settings.ui || {}).path) || 'ui';
	
// Create the complete server-side path
uiPath = '/' + uiPath + '/ui_svg_graphics';

// Replace a sequence of multiple slashes (e.g. // or ///) by a single one
uiPath = uiPath.replace(/\/+/g, '/');
	
// Make the unicode conversion available (to the DASHBOARD).
RED.httpNode.get(uiPath + "/:cmd/:value", function(req, res){
   ...
})

```

And this code snippet is doing well - in all kind of situations - already quite some time!

But last week I got a Github [issue](https://github.com/bartbutenaers/node-red-contrib-ui-svg/issues/86#issuecomment-753406485). Seems that my endpoint is:

- unreachable when the settings contain `UI: { path: "" }`
- reachable when the settings containg `UI: { path: "/" }`

Does anybody see what I am doing wrong? I assume it is something stupid, but I don't see it for some reason ... And I also don't want to mess things up for all other users, where it is working fine now ...

Thanks a lot !!!  
Bart
