I think you can not add empty strings..
empty = no value
you can do something like replacing empty with no space or one space
"..(if $string2 = empty then ' ' else $string2)...
This is a very good question, this is the result of a Java quirk.
The reason why this happens is that + can be used for different things, and the JVM figures out in what way it is used from the context. When one of the arguments is a String, it is assumed that + is used for String concatenation. If both arguments are Numbers (or primitives of type int, long, etc, I guess) it is assumed that it is used for addition.
If both arguments are null, they don't have a type, so there is no way to figure out what to do with the + in this case, so an error is thrown.
I agree with you that when using Mendix you shouldn't need to worry about these Java implementation details. The way this should have been handled should have been that an empty String would result. I consider it both a bug that "null" is used at all and that you run into this error in this case. I'm sure the "Existing applications rely on the current behaviour" card would be played if you submitted a change request though :).