1. Code:
    03:46 [Error] Failed to call hook 'Unload' on plugin 'MySqlConnector v4.2017.301' (NullReferenceException: Object reference not set to an instance of an object)
    03:46 [Stacktrace]   at MySql.Data.MySqlClient.MySqlDataReader.Close () [0x00000] in <filename unknown>:0
      at MySql.Data.MySqlClient.MySqlConnection.Close () [0x00000] in <filename unknown>:0
      at Oxide.Core.MySql.Libraries.MySql.CloseDb (Oxide.Core.Database.Connection db) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.MySqlDatabase.Close () [0x00000] in <filename unknown>:0
      at Oxide.Plugins.MySqlConnector.Unload () [0x00000] in <filename unknown>:0
      at Oxide.Plugins.MySqlConnector.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in <filename unknown>:0 
    It seems that this error occurs if there is an unfinished transaction. Maybe, need to update MySql.Data.dll lib
     
  2. You need to talk to the coder who made you the custom plugin
     
  3. Talk to yourself?
     
  4. Don't think that's a custom plugin. MySQL Extension | Oxide
     
  5. I done a search came up with nothing its why I thought it was a custom one well in that case then it needs posted in the plugin topic for support
     
  6. There is actually not a support thread, it's part of Oxide. This is where it belongs.
    [DOUBLEPOST=1492368826][/DOUBLEPOST]Well, or in the Rust Discussion.
     
  7. Wulf

    Wulf Community Admin

    MySqlConnector is the name of the plugin the OP is using, which is not from Oxide. Without seeing code, it's hard to know exactly what the OP is doing with the plugin for it to throw this error.
     
  8. Code:
    using System;
    using System.Collections.Generic;
    using Oxide.Core.MySql.Libraries;
    using Oxide.Core.Database;namespace Oxide.Plugins {
        [Info("MySqlTest", "MySqlTest", "1.0.0")]
        public class MySqlTest : RustPlugin {
            Oxide.Core.MySql.Libraries.MySql mySql;
            Connection connection;        void Init() {
                mySql = new Oxide.Core.MySql.Libraries.MySql();
                connection = mySql.OpenDb("localhost", 3306, "oxide", "oxide", "oxide", this, true);            mySql.Query(new Sql("SELECT * FROM players LIMIT 10"), connection, (List<Dictionary<string, object>> rows) => {
                    foreach (var row in rows) {
                        Puts(Convert.ToString(row["steamID"]));
                    }
                });
            }        void Unload() {
                // eg last transaction
                mySql.Query(new Sql("SELECT * FROM players LIMIT 10"), connection, (List<Dictionary<string, object>> rows) => {
                    foreach (var row in rows) {
                        Puts(Convert.ToString(row["steamID"]));
                    }
                });            mySql.CloseDb(connection);
            }
        }
    }
    
    Code:
    18:01 [Info] Unloaded plugin MySqlTest v1.0.0 by MySqlTest
    6:01 PM [Error] MySql handle raised an exception (NullReferenceException: Object reference not set to an instance of an object)
    6:01 PM [Stacktrace]   at MySql.Data.MySqlClient.MySqlConnection.get_ServerThread () [0x00000] in <filename unknown>:0
      at MySql.Data.MySqlClient.MySqlConnection.Abort () [0x00000] in <filename unknown>:0
      at (wrapper remoting-invoke-with-check) MySql.Data.MySqlClient.MySqlConnection:Abort ()
      at MySql.Data.MySqlClient.MySqlDataReader.NextResult () [0x00000] in <filename unknown>:0
      at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader (CommandBehavior behavior) [0x00000] in <filename unknown>:0
      at MySql.Data.MySqlClient.MySqlCommand.AsyncExecuteWrapper (Int32 type, CommandBehavior behavior) [0x00000] in <filename unknown>:0
    18:01 [Error] MySql command callback raised an exception (NullReferenceException: Object reference not set to an instance of an object)
    18:01 [Stacktrace]   at Oxide.Plugins.MySqlTest.<Unload>m__1 (System.Collections.Generic.List`1 rows) [0x00000] in <filename unknown>:0
      at Oxide.Core.MySql.Libraries.MySql+MySqlQuery+<>c__DisplayClass24_0.<Handle>b__0 () [0x00000] in <filename unknown>:0