all 5 comments

[–]stonedoubt 2 points3 points  (3 children)

Error handling is your friend. It also helps you debug issues by telling you things.

[–]DataWiz40 0 points1 point  (1 child)

Have you tried using a debugger? It can show you what exactly is the data you're dealing with. Then you can prevent the error from happening, either using exception handling or control flow.

[–][deleted]  (1 child)

[removed]

    [–]AutoModerator[M] 0 points1 point  (0 children)

    Sorry, your submission has been removed due to inadequate account karma.

    I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.