Skip to content

Commit 0378d1d

Browse files
Update to version 1.0.2.3
Added a null check in WaveBankExtractor initializer. Should stop any crashes caused by not being able to locate Terraria's content directory.
1 parent 2df06b1 commit 0378d1d

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

QuickWaveBank/Extracting/WaveBankExtractor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public static string GetTrackName(int index) {
105105
string name = TrackNames[index];
106106
if (name.Length >= 3) {
107107
if (char.IsDigit(name[0]) && char.IsDigit(name[1]) && (name[2] == '_' || name[2] == ' '))
108-
name = name.Substring(3).TrimWhitespace();
108+
name = name.Substring(3).Trim();
109109
}
110110
return name;
111111
}
@@ -131,7 +131,7 @@ static WaveBankExtractor() {
131131
ReadWaveBankList(path);
132132
return;
133133
}
134-
if (TerrariaLocator.TerrariaContentDirectory != "") {
134+
if (!string.IsNullOrEmpty(TerrariaLocator.TerrariaContentDirectory)) {
135135
path = Path.Combine(
136136
Path.GetDirectoryName(TerrariaLocator.TerrariaContentDirectory),
137137
WaveBankList

QuickWaveBank/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("1.0.2.2")]
55-
[assembly: AssemblyFileVersion("1.0.2.2")]
54+
[assembly: AssemblyVersion("1.0.2.3")]
55+
[assembly: AssemblyFileVersion("1.0.2.3")]
5656
[assembly: Guid("81CB3338-5599-449F-A2A4-2C37A245551F")]
5757
[assembly: NeutralResourcesLanguage("en-US")]
5858

QuickWaveBank/Util/Extensions.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
namespace QuickWaveBank.Util {
1111
/**<summary>A collection of useful extensions.</summary>*/
1212
public static class Extensions {
13-
/**<summary>Trims whitespace off of a string.</summary>*/
14-
public static string TrimWhitespace(this string s) {
15-
return s.Trim(' ', '\t', '\r', '\n');
16-
}
1713
/**<summary>Fills an array with a value.</summary>*/
1814
public static void Fill<T>(this T[] array, T with) {
1915
for (int i = 0; i < array.Length; i++) {

QuickWaveBank/Xap/XapFile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private string[] ReadTokens(StreamReader reader) {
170170
for (int i = 0; i < text.Length; i++) {
171171
char c = text[i];
172172
if (IsFormatCharacter(c)) {
173-
token = text.Substring(0, i).TrimWhitespace();
173+
token = text.Substring(0, i).Trim();
174174
if (token.Length > 0)
175175
tokens.Add(token);
176176
tokens.Add(new string(c, 1));
@@ -183,7 +183,7 @@ private string[] ReadTokens(StreamReader reader) {
183183
}
184184
}
185185

186-
token = text.TrimWhitespace();
186+
token = text.Trim();
187187
if (token.Length > 0)
188188
tokens.Add(token);
189189

0 commit comments

Comments
 (0)