Topic: zrObject.ExtractFileToDisk - Unhandled Exception
I'm currently using your module to write an auto-updater for my little radio app. I think I have found 2 glitches/bugs.
When I extract all files back to disk I get the following error message that results in a crash:
"Unhandled Exception::Attempt to access field or method of Null object"
1. You get this crash if you try to extract a directory that is aready present. (I got around this by a simple check for a "." inside the filename)
2. You get this crash when the file to be extracted is already in use (prp.exe or fmod.dll)
Can you prevent these crashes somehow? These files / dirs mentioned above should just be skipped.
Example core function
Function Extract_Zip() Local zrObject:ZipReader = New ZipReader Local Extracted_file:String Local Scr_file:String SetGadgetText(Curr_Msg_Lab,"Extracting File: ") If ( zrObject.OpenZip(ServerZIPFile) ) Then For Local i:Int=1 To zrObject.getFileCount()-1 Scr_file:String=zrObject.getFileInfo(i).zipFileName Extracted_file=Replace(Scr_file,"Pocket Radio Player/","") If Extracted_file.find(".")>0 Then zrObject.ExtractFileToDisk(Scr_file, Extracted_file, True) <- This one!! Next zrObject.CloseZip() End If End Function
I can also send you a complete code for testing if needed.
Thanks in advance.