Skip to content

Commit

Permalink
Fixed crash if namespace is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Chailotl committed Apr 12, 2021
1 parent b206d68 commit 82938a0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions minecraft-resource-manager/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,15 @@ private void BlockModels_SelectionChanged(object sender, SelectionChangedEventAr

string id = item.ToString();
int i = id.IndexOf(':');
string mod = id.Remove(i);
string block = id.Substring(i + 1);
string mod, block;
if (i == -1)
{
mod = "minecraft";
block = id;
} else {
mod = id.Remove(i);
block = id.Substring(i + 1);
}

openFile($@"{resourceFolder}\assets\{mod}\models\{block}.json");
}
Expand Down

0 comments on commit 82938a0

Please sign in to comment.