Gregtech++ [GT++] [GTplusplus]

Gregtech++ [GT++] [GTplusplus]

94.1k Downloads

NPE crashes the game when gt++ checking new version during PreInit

GWYOG opened this issue ยท 6 comments

commented

Crashreport: http://pastebin.com/sCKApGka
(Using GT++1.4.9-release)

I believe this crash happens everytime the network checking in NetworkUtils.java fails and return false.
Thus the getContentFromURL() method in NetworkUtils.java will always return null.
Then when calculating the value of the field MASTER_VERSION in Core.java, there will always be a null.toLowerCase(), which will cause a NPE crashing the game.

I think not only the return null; in NetworkUtils.java should be changed, but also the netIsAvailable() method should use other website rather than google to check the net-connecting status.
The reason of the latter part is that actually there's a Greet Firewall in China which forbids the Chinese to browse some foreign website, such as Google, YouTube or Twitter. So nearly all the Chinese player will fails the net-checking of gt++. I think maybe gt++ should double-check http://www.baidu.com (which is a Chinese website) if it fails to connect to google, or use other foreign websites instead of google. (Maybe github?)

commented

I think this bug is the continuation of #27 and is terrible for Chinese players since the existence of the Great Firewall. DX

commented

I wasn't aware of this issue for eastern players.

I'll fix it for 1.5.

commented

Yeah, it seems that the bug has completely been fixed.
I tested both offline and online. No crash occurred and it fetched the version info on GitHub correctly in the log when I was online.
(Though it always says my GT++ needs update everytime when I login, which made me confused for a while.) (Since the recommended version is still 1.4.9-release.)

Thanks for the fix! :D

commented

The most up to date version is still 1.4.9, as I've released the above update as a prerelease. It'll roll around as the official release in the next few days.

commented

Got it. =D