Commit 5fd73ed3 authored by FrancoisEricMerlin's avatar FrancoisEricMerlin
Browse files

null pointer exception during compare version

parent b5f47233
......@@ -410,7 +410,9 @@ public class SiteService
component.addReleaseComment( strComment );
}
else
if ( component.getLastAvailableVersion( ) != null
if ( component.getLastAvailableVersion( ) != null
&& component.getTargetVersion( )!=null
&& component.getLastAvailableVersion( )!=null
&& ReleaserUtils.compareVersion( component.getTargetVersion( ), component.getLastAvailableVersion( ) ) < 0 )
{
String [ ] arguments = {
......
......@@ -447,10 +447,14 @@ public class ReleaserUtils
public static int compareVersion( String strVersion1, String strVersion2 )
{
ComparableVersion cVersion1 = new ComparableVersion( strVersion1 );
ComparableVersion cVersion2 = new ComparableVersion( strVersion2 );
if( strVersion1!=null && strVersion2!=null)
{
ComparableVersion cVersion1 = new ComparableVersion( strVersion1 );
ComparableVersion cVersion2 = new ComparableVersion( strVersion2 );
return cVersion1.compareTo( cVersion2 );
return cVersion1.compareTo( cVersion2 );
}
return -1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment