Fixed getvariableofnpc

Would crash when target npc's variable database is empty.
Special Thanks to Haruna, ossi0110

Signed-off-by: shennetsind <ind@henn.et>