The Kinetic Jump site navigation header requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

Welcome Guest Search | Active Topics | Log In | Register

updateController.ReadLastUpdateInformation() null? Options
YvesR
#1 Posted : Tuesday, October 11, 2011 1:05:35 AM
Rank: Member
Groups: Member

Joined: 4/27/2011
Posts: 14
Location: Hasselt, Belgium
Hi Brian,

A new version with the automatic update mechanism is being rolled out in production environment (yay! :-) ). But with production environments special situations can occur :-).

We now had a single client PC that threw us an error "NullReferenceException". Using our own logging we could determine which piece of code went wrong:
- applying the update
- reading the last update result
- special handling depending on the last update result.

The first bit "applying the update" went OK. We know this because we examined the log output of AppLife Update. The update process ended with "SUCCESS" and each step during the update process seemed OK.

The second bit "reading the last update result" is done by (local var) updateController.ReadLastUpdateInformation(); This method gives us a "LastResult" object containing information about the last update. We were wondering, because our code now doens't check this explicitly, if there are situations that this "ReadLastUpdateInformation" method can return a "null" object. Our code further on depends on this object to read e.g. lastUpdate.Result.

We will modify our code to check if the ReadLastUpdateInformation returns a "null" value (best practice). But knowing if the method returns a "null" value will help us understand what can go wrong or in what situation(s).

Thx in advance!

Greetz,

Yves
adamh
#2 Posted : Tuesday, October 11, 2011 8:18:12 AM
Rank: Administration
Groups: Member, Administration

Joined: 7/12/2007
Posts: 17
Location: Michigan
Yes, that method can return null. This will happen when no "last update" information is found in the registry. Since you're checking this only after applying the update, it's surprising that the information isn't present. This could be caused by either an update created by a much older version of AppLife Update, or possibly by an update applied by a different user.
Adam Hill
Kinetic Jump Software
YvesR
#3 Posted : Tuesday, October 11, 2011 11:42:34 PM
Rank: Member
Groups: Member

Joined: 4/27/2011
Posts: 14
Location: Hasselt, Belgium
Hi Adam,

Mmmm... strange.
The version used to build the package is 4.0.2.25. And the update is applied within the same Windows session. We only read the LastUpdate property after we applied an update to check whether it was a successful update or not.

Either way, our code is modified to check explicitly if the object is empty. If i get more information about what circomstances this error occurs and it doesn't apply for the situations described by you Adam I will post it here.

Greetz,

Yves
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.