{"action":"created","issue":{"url":"https://api.github.com/repos/pBlueG/SA-MP-MySQL/issues/68","labels_url":"https://api.github.com/repos/pBlueG/SA-MP-MySQL/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/pBlueG/SA-MP-MySQL/issues/68/comments","events_url":"https://api.github.com/repos/pBlueG/SA-MP-MySQL/issues/68/events","html_url":"https://github.com/pBlueG/SA-MP-MySQL/issues/68","id":107040133,"number":68,"title":"orm_load crashing server when there is a NULL field","user":{"login":"IstuntmanI","id":6208948,"avatar_url":"https://avatars.githubusercontent.com/u/6208948?v=3","gravatar_id":"","url":"https://api.github.com/users/IstuntmanI","html_url":"https://github.com/IstuntmanI","followers_url":"https://api.github.com/users/IstuntmanI/followers","following_url":"https://api.github.com/users/IstuntmanI/following{/other_user}","gists_url":"https://api.github.com/users/IstuntmanI/gists{/gist_id}","starred_url":"https://api.github.com/users/IstuntmanI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IstuntmanI/subscriptions","organizations_url":"https://api.github.com/users/IstuntmanI/orgs","repos_url":"https://api.github.com/users/IstuntmanI/repos","events_url":"https://api.github.com/users/IstuntmanI/events{/privacy}","received_events_url":"https://api.github.com/users/IstuntmanI/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-17T18:08:18Z","updated_at":"2015-09-17T19:02:41Z","closed_at":null,"body":"So, as the title says, I just discovered something which looks like a bug (well, it is).\r\n\r\nI firstly create an ORM object, then I add an orm_addvar_string (maybe others too, idk, I don't have time to test it too much, but this is how I did it for this specific column) for that ORM id, then when I use orm_load and that field is NULL, the orm_load is processed ok, it shows the debug after it. But when the specified callback has to be called, it isn't even printing the first debug print, because it crashes before the callback is processed.\r\n\r\nThis is what server outputs:\r\n```\r\n[17/09/2015 20:47:38] OnPlayerLogin JAJA\r\n[17/09/2015 20:47:38] [debug] Server crashed due to an unknown error\r\n[17/09/2015 20:47:39] [debug] Native backtrace:\r\n[17/09/2015 20:47:39] [debug] #0 00403270 in ?? () from samp-server.exe\r\n[17/09/2015 20:47:39] [debug] #1 65e41c89 in ?? () from plugins\\mysql.DLL\r\n[17/09/2015 20:47:39] [debug] #2 00469a46 in ?? () from samp-server.exe\r\n[17/09/2015 20:47:39] [debug] #3 0048d46b in ?? () from samp-server.exe\r\n[17/09/2015 20:47:39] [debug] #4 0049b431 in ?? () from samp-server.exe\r\n[17/09/2015 20:47:39] [debug] #5 0049b441 in ?? () from samp-server.exe\r\n```\r\n\r\nI can't provide a test script, and I don't know if this is an issue only in my gamemode (I am almost sure that this is a bug with the plugin), but this is what I encountered just now. I'm pretty busy ATM.\r\n\r\nCan somebody confirm this ?"},"comment":{"url":"https://api.github.com/repos/pBlueG/SA-MP-MySQL/issues/comments/141190525","html_url":"https://github.com/pBlueG/SA-MP-MySQL/issues/68#issuecomment-141190525","issue_url":"https://api.github.com/repos/pBlueG/SA-MP-MySQL/issues/68","id":141190525,"user":{"login":"maddinat0r","id":1799378,"avatar_url":"https://avatars.githubusercontent.com/u/1799378?v=3","gravatar_id":"","url":"https://api.github.com/users/maddinat0r","html_url":"https://github.com/maddinat0r","followers_url":"https://api.github.com/users/maddinat0r/followers","following_url":"https://api.github.com/users/maddinat0r/following{/other_user}","gists_url":"https://api.github.com/users/maddinat0r/gists{/gist_id}","starred_url":"https://api.github.com/users/maddinat0r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maddinat0r/subscriptions","organizations_url":"https://api.github.com/users/maddinat0r/orgs","repos_url":"https://api.github.com/users/maddinat0r/repos","events_url":"https://api.github.com/users/maddinat0r/events{/privacy}","received_events_url":"https://api.github.com/users/maddinat0r/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T19:02:41Z","updated_at":"2015-09-17T19:02:41Z","body":"Yup, seems like a bug [here](https://github.com/pBlueG/SA-MP-MySQL/blob/R39-3/src/COrm.cpp#L205). There's a null-pointer being passed to `amx_SetString` (if the field has a NULL value), which probably causes the crash (call stack confirms this)."}}