#3819: objFromId() throws uncaught exception if object not found
-------------------------------------------------+-------------------------
Reporter: aubergine | Owner: per
Type: bug | Status: new
Priority: normal | Milestone:
Component: JavaScript Issues | unspecified
Keywords: js, javascript, api, script, | Version: 3.1
objfromid | and master
| Operating System: All
| /Non-Specific
-------------------------------------------------+-------------------------
{{{
info |11:42:47: [getBaseObjFromId:887] getBaseObjFromId() failed for id
0
info |11:42:47: [getBaseObjFromId:887] Assert in Warzone:
/Users/dak180/Applications/Build/wz2100/hg/wz2100-git/macosx/../src/objmem.cpp:887
(!"couldn't find a BASE_OBJ with ID"), last script event: 'N/A'
error |11:42:47: [js_objFromId:1898] No such object id 0
info |11:42:47: [getBaseObjFromId:887] getBaseObjFromId() failed for id
0
info |11:42:47: [getBaseObjFromId:887] Assert in Warzone:
/Users/dak180/Applications/Build/wz2100/hg/wz2100-git/macosx/../src/objmem.cpp:887
(!"couldn't find a BASE_OBJ with ID"), last script event: 'N/A'
error |11:42:47: [js_objFromId:1898] No such object id 0
}}}
The exception is hitting the calling code in javascript.
Would it be possible for the JS API to catch that specific exception and
return either null or undefined (whichever is preferred, they both
typecast as falsey) if the object isn't found?
Related discussion in forums:
http://forums.wz2100.net/viewtopic.php?f=35&t=10036&start=15#p112104
--
Ticket URL: <http://developer.wz2100.net/ticket/3819>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Warzone2100-project mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/warzone2100-project