File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
app/src/main/kotlin/com/aliucord/manager/ui/screens/plugins Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -193,18 +193,22 @@ class PluginsModel(
193193 ? : throw IllegalStateException (" Failed to read plugins directory" )
194194
195195 val pluginItems = pluginFiles
196- .map {
197- PluginItem (
198- manifest = loadPluginManifest(it),
199- path = it.absolutePath,
200- )
196+ .mapNotNull {
197+ try {
198+ PluginItem (
199+ manifest = loadPluginManifest(it),
200+ path = it.absolutePath,
201+ )
202+ } catch (e: Exception ) {
203+ Log .e(BuildConfig .TAG , " Failed to load plugin at ${it.absolutePath} " , e)
204+ null
205+ }
201206 }
202207 .sortedBy { it.manifest.name }
203208
204209 plugins.value = pluginItems.toUnsafeImmutable()
205210 }
206211
207- // TODO: don't cause entire page to fail if one plugin is corrupted
208212 private fun loadPluginManifest (pluginFile : File ): PluginManifest {
209213 return ZipReader (pluginFile).use {
210214 val manifest = it.openEntry(" manifest.json" )
You can’t perform that action at this time.
0 commit comments