Bug in version 2.2.1 - TVRenameSettings.xml has size 0

GeoBG

13-08-2012 13:07:13

Hi,

You have an exceptionally useful and good program - congratulations.

I had however problems with updating to the new version 2.2.1.
I installed version 2.2.1 over version 2.2.0b10 and did some renames/updates. When I tried to save the the state (File/Save), I received the error: "Object reference not set to an instance of an object".
Trying to restart the program gave a diagnostic of "TVRename.Settings.xml : Root element is missing" and suggested a list of choices, which represented, I suppose, previous versions of the saved files.
The prompts were certainly not obvious for a casual user - they were "programmer oriented" (Xtree, knowledge of saved files, etc.). I only understood them after some investigations (see below).
I tried reinstalling the previous version, but got now the same result.
Waiting for activation for my new registration (to report the bug), I traced it to the fact that at each saving, the new version created a new file TVRenameSettings.xml with size 0. Since it also copied the previous version, incrementing the number, I had succeeded to wipe out 4 files already from my history.
The old version had stopped working because the file had now size 0.
Once I understood that, I copied the last good backup version over the root one and succeeded entering the program (both versions).
Version 2.2.1 created again a 0 size file while trying to save the information, with the same error "Object reference not set to an instance of an object".
I tried by the way refreshing the data in 2.2.1, hoping this would reinitialize some structures in the program.
Copying over the last good backup file and reinstalling version 2.2.0b10 made at least version 2.2.0b10 work again.

All the best,

-- George

sstteevvee

15-08-2012 22:26:54

When it does the "Object reference..." message, is there more details below that, that you can send me?

Also, could you email me your (full size) TVRenameSettings.xml file (send it to tvrename [at] tvrename.com) and I'll have a look at it this weekend.

GeoBG

15-08-2012 23:37:42

I have a new update:
After I reinstalled version 2.2.1 and got the previous error, I rerun the program and chose default (empty) configuration.
I tried adding a Series and save - got the same error.
I rerun the program once again with empty configuration and tried saving without adding any files - got the same error.

It does not look that the problem is therefore in the config files - maybe some of the paths is incorrect in the write (assumes a folder like the ones created by 2.2.1 and not one carried over from
The file itself is created (with size 0), so in the creation itself that path is correct (C:\Users\George\AppData\Roaming\TVRename\TVRename\2.1).
Obviously there is an exception that is not treated correctly here - if an error occurs in the write, the renaming sequence should not take place (assuming it is executed to a temporary file before the renaming).
If you write directly over the file (e.g., copy it first), all I said about the paths seems incorrect, and there is probably some other error during the write.

I am sending you the settings file anyway.
If all the information is kept in the files Layout, Statistics, TheTVDB and TVRenameSettings EXCLUSIVELY (please confirm), I can try saving the files, uninstalling 2.2.0b10, deleting the directories, installing 2.2.1 and copying over the saved files.
It might solve my problem, but in this case it would hide the error, so you might prefer that I do not do that.

All the best,

-- George

GeoBG

15-08-2012 23:50:02

Just in case I didn't write it before: the error message has no additional information.

JoeBiellik

16-08-2012 09:17:59

I'm getting the exact same error since updating; when I try to save I get a error message box "Object reference not set to an instance of an object.", and it it creates a blank "TVRenameSettings.xml" file.

A clean install with or without the old settings files results in exactly the same error.

JoeBiellik

16-08-2012 09:32:48

Think I've found the source of the bug.

By default the Automatic Export of missing EPs to XML is *enabled* in the settings, without a valid file path. Looks like just unchecking the XML export option (or adding a valid path) fixes the problem. Maybe you should release an update with it unchecked by default.

GeoBG

16-08-2012 22:18:56

I reinstalled 2.2.1 to check JoeBiellik's post - thank you for the post.

In my case the Automatic Export tab had all the selections disabled (and no paths defined).

I decided to check other folders.
In uTorrent/NZB tab, I had resume.dat defined and pointing to "C:\Users\George\AppData\Roaming\uTorrent\resume.dat".
I clicked on the "Browse..." button and it opened the Documents folder instead of the right one (which happens on Vista if the defined path does not exist).
I browsed to the correct one (the one that was actually in the resume.dat path in the text box) and chose the file again.
Clicking the "Browse..." button now opens the correct folder, as specified in the text box.

After that I tried saving my settings, expecting the error, but the program saved the settings file correctly and now I cannot reproduce the error.
I might have enabled and disabled again the check box for exporting to XML when playing with the tab.

sstteevvee

18-08-2012 14:34:57

I've tracked the error down, and have fixed it in the new version of TVRename that I'll upload in the next couple of days.

As workaround, open and close the Preferences dialog (you don't need to change anything), and that should then allow you to save without an error.

I've double-checked the defaults for the "Automatic Export..." options, and they all default to off. If you're a long-time user of TVRename and used those settings in the 2.1.x days, they were hidden in 2.2.x, and are now back, and will still be whatever you set them to three years ago!

GeoBG

18-08-2012 21:33:39

Your post explains the behavior I got in my last post - I basically performed your "work around" without knowing it.

Thank you for your quick reaction.

Good work!

I also saw what you wrote in the release channel.
You should probably add something about copying over the previous version of TVRenameSettings or point to this thread - people who downloaded before you posted your new comment may be stuck with a situation where nothing works.
Even reinstalling previous versions of the program won't help them (since they already have a 0 size settings file) and worse, their trials can wipe out all their accumulated settings.

sstteevvee

19-08-2012 21:19:53

New version now available, including the fix for this bug.