xmind-sdk-python icon indicating copy to clipboard operation
xmind-sdk-python copied to clipboard

bug discovered

Open JJC3561 opened this issue 6 years ago • 0 comments

I hope this might help someone out there ...

file topic.py. line 263: if index < 0 or len(topic_list) >= index: # THIS IS WRONG

should be if index < 0 or index >= len(topic_list): #THIS IS CORRECT or if index < 0 or len(topic_list) <= index: #THIS IS CORRECT

[this is a mild bug :]

-- in normal situation, it will fail to "insertBefore()" and instead it will do "append()", when adding a new topic. -- in unusual situations, if one tries to "insertBefore()" a new topic with a (mistakenly) large index, it will crash instead of fail over to "append()"

JJC3561 avatar Feb 23 '19 00:02 JJC3561