Skript icon indicating copy to clipboard operation
Skript copied to clipboard

DefaultOperations.java - Add blank string default

Open Fusezion opened this issue 7 months ago • 38 comments

Description

This PR aims to add a new operations default of "" when someone does "example" + {_unset} The issue this is related to is marked as "Up for Debate", however from my perspective I see no harm in skript handling null with blank. I will mark this PR as draft, until a decision is firmly made by the team, any other feedback is welcome

While it's true in java "blank" + null throws a null point exception, there's also work arounds like Objects.toString() and String.valueOf(), I think there's more benefit from this over none.

If the main concern is someone does {_blank} + "Hello" and doesn't correctly handle their variable, then I believe having the ability to actually see the string missing their inputted type makes more sense than it abruptly becoming null especially in scenarios where they're doing "This " + {_that} + " and this" an error in their code is clearly visible and debuggable.


Target Minecraft Versions: any Requirements: none Related Issues: #6917

Fusezion avatar Mar 16 '25 11:03 Fusezion