Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 5821a1b

Browse files
Check first if object exists + some more tweaks
1 parent 0ebae16 commit 5821a1b

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

Toolset/libraries/revidelibrary.8.livecodescript

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3474,21 +3474,20 @@ on revIDECreateObject pObjectTypeID, pTarget, pLoc
34743474
end revIDECreateObject
34753475

34763476
on revIDECloneObject pLongID
3477+
if not exists(pLongID) then return __revIDEError("Cannot create object. Target does not exist:" && pLongID)
3478+
34773479
if word 1 of pLongID is "card" or word 1 of pLongID is "stack" then
34783480
clone pLongID
34793481
else
3480-
34813482
local tTarget, tLoc, tControlType
34823483
local tCreatedControlID
34833484

34843485
put the loc of pLongID into tLoc
34853486
add 20 to item 1 of tLoc
34863487
add 20 to item 2 of tLoc
3487-
3488-
if not exists(pLongID) then return __revIDEError("Cannot create object. Target does not exist:" && pLongID)
34893488

34903489
clone pLongID
3491-
put the long ID of it into tCreatedControlID
3490+
put it into tCreatedControlID
34923491
set the loc of tCreatedControlID to tLoc
34933492
end if
34943493
end revIDECloneObject

0 commit comments

Comments
 (0)