Commits
md_5 authored 44535786cbb
52 52 | } |
53 53 | |
54 54 | public String getShaMappingsHash() |
55 55 | { |
56 56 | return hashFromUrl( mappingsUrl ); |
57 57 | } |
58 58 | private static final Pattern URL_PATTERN = Pattern.compile( "https://launcher.mojang.com/v1/objects/([0-9a-f]{40})/.*" ); |
59 59 | |
60 60 | public static String hashFromUrl(String url) |
61 61 | { |
62 + | if ( url == null ) |
63 + | { |
64 + | return null; |
65 + | } |
66 + | |
62 67 | Matcher match = URL_PATTERN.matcher( url ); |
63 68 | return ( match.find() ) ? match.group( 1 ) : null; |
64 69 | } |
65 70 | } |