History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-2671
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Unassigned
Reporter: AlSt
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
QuickBuild

Pipeline view is throwing exception because of getCachedLatestBuild()

Created: 21/Mar/16 12:10 PM   Updated: 22/Mar/16 02:01 AM
Component/s: None
Affects Version/s: 6.1.8
Fix Version/s: 6.1.9

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
The Pipeline Gadget and also the Pipeline page of a configuration is throwing an exception:
java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
at com.google.common.base.Absent.get(Absent.java:42)
at com.pmease.quickbuild.model.Configuration.getCachedLatestBuild(Configuration.java:2133)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:196)
at

The source code for this is:
public Build getCachedLatestBuild() {
if (cachedLatestBuild == null)
cachedLatestBuild = Optional.fromNullable(getLatestBuild());
return cachedLatestBuild.get();
}

Maybe checking also if the optional is empty in the if might make sense?

 All   Comments   Work Log   Change History      Sort Order:
AlSt [21/Mar/16 12:24 PM]
Why are you using Optional there anyway? It is never used for what's it's supposed to be. There is never a check with chachedLatestBuild.isPresent()!