Simply put, it is most probably of a non-valid handle.
Maybe, a bug already had been in the code before and it already was only by luck that you had no problems before, or you changed more than you remember within the code after importing.
Test the validity of the handle!
Is there still the file?
How did you store the handle?
Did you store it within a skill, is the skill used more than once?
Is the pointer valid?
Or did you insert a wait after ptr_for_handle, and before using that pointer?

Does it simply crash, or do you get an error message?