• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版a5f1859cf58a311c08fadb346c3e5d937496892d (tree)
时间2016-08-15 00:35:46
作者yyagi <yyagi@16f4...>
Commiteryyagi

Log Message

#36548 FIx not to cause NullReference Exception when DTXMania was used as DTXV mode
#xxxxx Add try-catch foropening System/resources.csv

git-svn-id: http://svn.osdn.jp/svnroot/dtxmania/trunk@1032 16f42ceb-6dc6-49c8-ba94-f2d53467949d

更改概述

  • delete: "DTXMania\343\203\227\343\203\255\343\202\270\343\202\247\343\202\257\343\203\210/\343\202\263\343\203\274\343\203\211/\343\202\271\343\203\206\343\203\274\343\202\270/07.\346\274\224\345\245\217/CStage\346\274\224\345\245\217\347\224\273\351\235\242\345\205\261\351\200\232.cs"
  • delete: "DTXMania\343\203\227\343\203\255\343\202\270\343\202\247\343\202\257\343\203\210/\343\202\263\343\203\274\343\203\211/\345\205\250\344\275\223/CResources.cs"

差异

--- "a/DTXMania\343\203\227\343\203\255\343\202\270\343\202\247\343\202\257\343\203\210/\343\202\263\343\203\274\343\203\211/\343\202\271\343\203\206\343\203\274\343\202\270/07.\346\274\224\345\245\217/CStage\346\274\224\345\245\217\347\224\273\351\235\242\345\205\261\351\200\232.cs"
+++ "b/DTXMania\343\203\227\343\203\255\343\202\270\343\202\247\343\202\257\343\203\210/\343\202\263\343\203\274\343\203\211/\343\202\271\343\203\206\343\203\274\343\202\270/07.\346\274\224\345\245\217/CStage\346\274\224\345\245\217\347\224\273\351\235\242\345\205\261\351\200\232.cs"
@@ -478,7 +478,8 @@ namespace DTXMania
478478
479479 // PANELの設定は、base.On活性化()の後に(actPanelの活性化の後)行うこと。
480480 // さもないと、actPanelが活性化されていないため、パネル文字列の設定が機能しなくなる。
481- string strLabel = CDTXMania.Instance.stage選曲.r確定された曲.ar難易度ラベル[ CDTXMania.Instance.stage選曲.n確定された曲の難易度 ];
481+ string strLabel = (CDTXMania.Instance.stage選曲.r確定された曲 == null)?
482+ null : CDTXMania.Instance.stage選曲.r確定された曲.ar難易度ラベル[ CDTXMania.Instance.stage選曲.n確定された曲の難易度 ];
482483 string strPanel = CDTXMania.Instance.DTX.TITLE;
483484 //string strSETDEFlabel = CDTXMania.Instance.stage選曲.r確定された曲.strタイトル;
484485 if ( !string.IsNullOrWhiteSpace( strLabel ) && !strPanel.Contains(strLabel)
--- "a/DTXMania\343\203\227\343\203\255\343\202\270\343\202\247\343\202\257\343\203\210/\343\202\263\343\203\274\343\203\211/\345\205\250\344\275\223/CResources.cs"
+++ "b/DTXMania\343\203\227\343\203\255\343\202\270\343\202\247\343\202\257\343\203\210/\343\202\263\343\203\274\343\203\211/\345\205\250\344\275\223/CResources.cs"
@@ -34,7 +34,7 @@ namespace DTXMania
3434 if ( strLanguageCode == "" || strLanguageCode == null )
3535 {
3636 string s = System.Threading.Thread.CurrentThread.CurrentUICulture.Name;
37- if ( s == "" || !csvHeader.Contains( s+".title" ) )
37+ if ( s == "" || csvHeader == null || !csvHeader.Contains( s+".title" ) )
3838 {
3939 strLanguageCode = "default";
4040 }
@@ -52,7 +52,7 @@ namespace DTXMania
5252 if ( value == "" || value == null )
5353 {
5454 string s = System.Threading.Thread.CurrentThread.CurrentUICulture.Name;
55- if ( s == "" || !csvHeader.Contains( s + ".title" ) )
55+ if ( s == "" || csvHeader == null || !csvHeader.Contains( s + ".title" ) )
5656 {
5757 strLanguageCode = "default";
5858 }
@@ -63,7 +63,7 @@ namespace DTXMania
6363 }
6464 else
6565 {
66- if ( !csvHeader.Contains( value + ".title" ) )
66+ if ( csvHeader == null || !csvHeader.Contains( value + ".title" ) )
6767 {
6868 strLanguageCode = "default";
6969 }
@@ -211,12 +211,20 @@ namespace DTXMania
211211 public void LoadResources(string language = "")
212212 {
213213 // 参考: http://dobon.net/vb/dotnet/file/readcsvfile.html
214+ Microsoft.VisualBasic.FileIO.TextFieldParser tfp;
215+ try
216+ {
217+ tfp = new Microsoft.VisualBasic.FileIO.TextFieldParser(
218+ csvFileName,
219+ System.Text.Encoding.Unicode
220+ );
221+ }
222+ catch ( System.IO.FileNotFoundException e )
223+ {
224+ Trace.TraceError( "言語情報ファイル System/resources.csv が見つかりませんでした。" + e.Message );
225+ return;
226+ }
214227
215- Microsoft.VisualBasic.FileIO.TextFieldParser tfp =
216- new Microsoft.VisualBasic.FileIO.TextFieldParser(
217- csvFileName,
218- System.Text.Encoding.Unicode
219- );
220228 //フィールドが文字で区切られているとする
221229 //デフォルトでDelimitedなので、必要なし
222230 tfp.TextFieldType = Microsoft.VisualBasic.FileIO.FieldType.Delimited;