You’re going down the street to dig out a rabbit hole to find a carrot instead of walking into the produce market.
You have a equally dimensioned list, with only good data values, so while what @erfajo showed may work (his stuff usually does), it’s not necessary so I haven’t tested it (in the Orchid package if you do want to test it).
Currently you are asking Dynamo to find a value in a list, pull it from the list, edit the value by adding the - suffix, and then put it back in the list where it was. Dynamo is telling you ‘well that value doesn’t exist here’ by putting in a null. You don’t want null as that will wind up back in your list (as you noticed). You could replace the null after you put the good value in the list, but you’re already doing all this work and still have a ways to go. And on a significant dataset all these tests and movements are going to tax your system and run slow.
So instead, why not try to ask dynamo to do something only IF something is true, otherwise just do something else (like pass on the original value).
You can do that with a single codeblock like this:
YourDataSet==YourTargets? YourDataSet+"-": YourDataSet;
Remember your if statement syntax. The ? is defining the end of your test, the : is defining the end of your thing if true, and the ; is defining the end of your line of code.
If you’re not up for an IF statement in a code block, you can do this with 4 nodes like so:
Personally I prefer the simplicity of the code block here, especially when it can be leveraged in conjunction with other operations (like your string from object node).