openplanet-nl / plugin-manager

In-game plugin manager, installer, and updater.
6 stars 5 forks source link

Unloading a plugin while a tab for that plugin is open causes a null pointer exception. #21

Closed XertroV closed 1 year ago

XertroV commented 1 year ago

Unloading a plugin while a tab for that plugin is open causes a null pointer exception.

[   ScriptRuntime] [11:12:59] [mm-plugin-manager]  Script exception: Null pointer access
[   ScriptRuntime] [11:12:59] [mm-plugin-manager]    C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Utils/PluginInfo.as (line 174, column 3)
[   ScriptRuntime] [11:12:59] [mm-plugin-manager]      #0  Version PluginInfo::GetInstalledVersion() (C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Utils/PluginInfo.as line 174)
[   ScriptRuntime] [11:12:59] [mm-plugin-manager]      #1  void Controls::PluginChangelog(PluginInfo@ plugin, bool onlyUpdates = false) (C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Controls/PluginChangelog.as line 7)
[   ScriptRuntime] [11:12:59] [mm-plugin-manager]      #2  void PluginTab::Render() (C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Tabs/Plugin.as line 329)
[   ScriptRuntime] [11:12:59] [mm-plugin-manager]      #3  void Window::RenderTabContents(Tab@ tab) (C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Window.as line 32)
[   ScriptRuntime] [11:12:59] [mm-plugin-manager]      #4  void Window::Render() (C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Window.as line 73)
[   ScriptRuntime] [11:12:59] [mm-plugin-manager]      #5  void RenderInterface() (C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/main.as line 27)
[   ScriptRuntime] [11:12:59]  Unrolling dangling script UI stack: C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Tabs/Plugin.as line 268
[   ScriptRuntime] [11:12:59]  Unrolling dangling script UI stack: C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Window.as line 31
[   ScriptRuntime] [11:12:59]  Unrolling dangling script UI stack: C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Window.as line 71
[   ScriptRuntime] [11:12:59]  Unrolling dangling script UI stack: C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Tab.as line 15
[   ScriptRuntime] [11:12:59]  Unrolling dangling script UI stack: C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Tab.as line 14
[   ScriptRuntime] [11:12:59]  Unrolling dangling script UI stack: C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Tab.as line 13
[   ScriptRuntime] [11:12:59]  Unrolling dangling script UI stack: C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Window.as line 59
[   ScriptRuntime] [11:12:59]  Unrolling dangling script UI stack: C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Window.as line 51
[   ScriptRuntime] [11:12:59]  Unrolling dangling script UI stack: C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Tab.as line 15
[   ScriptRuntime] [11:12:59]  Unrolling dangling script UI stack: C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Tab.as line 14
[   ScriptRuntime] [11:12:59]  Unrolling dangling script UI stack: C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Tab.as line 13
[   ScriptRuntime] [11:12:59]  Unrolling dangling script UI stack: C:/Users/xertrov/OpenplanetNext/Plugins/mm-plugin-manager/src/Interface/Window.as line 44

Line 174 is the return statement in:

    Version GetInstalledVersion() {
        if (!m_isInstalled) {
            return Version("0.0.0");
        }
        return Version(Meta::GetPluginFromSiteID(m_siteID).Version);
    }
sylae commented 1 year ago

thats code i added in #20 rip

XertroV commented 1 year ago

This occurs while clicking 'update' from the plugin's page, too