File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,21 @@ public class Release
4848
4949 public System . Version GetVersion ( )
5050 {
51+ System . Version version ;
5152 string parsed = this . tag_name . ToLower ( ) . Replace ( "v" , "" ) ;
52- return new System . Version ( parsed ) ;
53+ int pos ;
54+ pos = parsed . IndexOf ( "-" ) ;
55+ if ( pos != - 1 ) parsed = parsed . Substring ( 0 , pos ) ;
56+ pos = parsed . IndexOf ( "+" ) ; ;
57+ if ( pos != - 1 ) parsed = parsed . Substring ( 0 , pos ) ;
58+ try {
59+ version = new System . Version ( parsed ) ;
60+ }
61+ catch ( FormatException ex ) {
62+ PolyTechMain . ptfInstance . ptfLogger . LogError ( "Invalid Version found while checking for mod updates, using fallback value 0.0.0" ) ;
63+ version = new System . Version ( "0.0.0" ) ;
64+ }
65+ return version ;
5366 }
5467 }
5568
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public class PolyTechMain : PolyTechMod
2323 public new const string
2424 PluginGuid = "polytech.polytechframework" ,
2525 PluginName = "PolyTech Framework" ,
26- PluginVersion = "0.9.1 " ;
26+ PluginVersion = "0.9.2 " ;
2727 private static BindingList < PolyTechMod >
2828 noncheatMods = new BindingList < PolyTechMod > { } ,
2929 cheatMods = new BindingList < PolyTechMod > { } ;
You can’t perform that action at this time.
0 commit comments