mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 16:18:55 +01:00 
			
		
		
		
	Avoid crash on loading invalid extension
(cherry picked from commit 460fbb18c7)
			
			
This commit is contained in:
		@@ -100,6 +100,12 @@ internal object ExtensionLoader {
 | 
			
		||||
        val versionName = pkgInfo.versionName
 | 
			
		||||
        val versionCode = pkgInfo.versionCode
 | 
			
		||||
 | 
			
		||||
        if (versionName.isNullOrEmpty()) {
 | 
			
		||||
            val exception = Exception("Missing versionName for extension $extName")
 | 
			
		||||
            Timber.w(exception)
 | 
			
		||||
            return LoadResult.Error(exception)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Validate lib version
 | 
			
		||||
        val majorLibVersion = versionName.substringBefore('.').toInt()
 | 
			
		||||
        if (majorLibVersion < LIB_VERSION_MIN || majorLibVersion > LIB_VERSION_MAX) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user