From 9bbfec25c24f45f4dd38d289ba27565fb326517c Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 20 Feb 2017 12:50:38 +1100 Subject: [PATCH] Fix /b for air displaying 'airfallback' --- MCGalaxy/Levels/Level.Blocks.cs | 2 +- MCGalaxy/util/Utils.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MCGalaxy/Levels/Level.Blocks.cs b/MCGalaxy/Levels/Level.Blocks.cs index 3455ddfbe..333e6d763 100644 --- a/MCGalaxy/Levels/Level.Blocks.cs +++ b/MCGalaxy/Levels/Level.Blocks.cs @@ -440,7 +440,7 @@ namespace MCGalaxy { if (block == Block.custom_block) { BlockDefinition def = CustomBlockDefs[extBlock]; return def == null ? extBlock.ToString() : def.Name.Replace(" ", ""); - } else if (block >= Block.CpeCount) { + } else if (block >= Block.CpeCount || block == Block.air) { return Block.Name(block); } else { BlockDefinition def = CustomBlockDefs[block]; diff --git a/MCGalaxy/util/Utils.cs b/MCGalaxy/util/Utils.cs index 0451d15d7..87da6c30e 100644 --- a/MCGalaxy/util/Utils.cs +++ b/MCGalaxy/util/Utils.cs @@ -101,7 +101,7 @@ namespace MCGalaxy { // Not all languages use . as their decimal point separator public static bool TryParseDecimal(string s, out float result) { - if (s.IndexOf(',') >= 0) s = s.Replace(',', '.'); + if (s != null && s.IndexOf(',') >= 0) s = s.Replace(',', '.'); result = 0; float temp; const NumberStyles style = NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite