We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a986c8c commit d25ef68Copy full SHA for d25ef68
src/amulet/nbt/nbt_encoding/string/write_string.cpp
@@ -223,7 +223,10 @@ namespace NBT {
223
224
inline void write_key(std::string& snbt, const StringTag& key)
225
{
226
- if (std::all_of(key.begin(), key.end(), [](char c) {
+ if (key.empty()) {
227
+ snbt.append("\"\"");
228
+ } else if (
229
+ std::all_of(key.begin(), key.end(), [](char c) {
230
return std::isalnum(c) || c == '.' || c == '_' || c == '+' || c == '-';
231
})) {
232
snbt.append(key);
0 commit comments