Skip to content

Commit

Permalink
Merge branch 'maintenance-2.12' and update version
Browse files Browse the repository at this point in the history
Includes NPE fix for issue #26.
  • Loading branch information
tomaswolf committed Nov 23, 2016
2 parents ac29523 + 93372fe commit feb51c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docu/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ with full SSO through Gerrit.

* License: [Apache Public License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
* [Home page](https://github.com/tomaswolf/gerrit-gitblit-plugin)
* Installed plugin version: <em id='gerrit-gitblit-current-version'>2.13.171.1-SNAPSHOT</em> &mdash; <a id='gerrit-gitblit-version-check' style='display:none;' href='#'>Check for updates</a>
* Installed plugin version: <em id='gerrit-gitblit-current-version'>2.13.171.2-SNAPSHOT</em> &mdash; <a id='gerrit-gitblit-version-check' style='display:none;' href='#'>Check for updates</a>

For a list of contributors, see at [GitHub](https://github.com/tomaswolf/gerrit-gitblit-plugin/graphs/contributors).

Expand Down Expand Up @@ -111,6 +111,6 @@ Report bugs or make feature requests at the [GitHub issue tracker](https://githu

<hr style="color: #C0C0C0; background-color: #C0C0C0; border-color: #C0C0C0; height: 2px;" />
<div style="float:right;">
<a href="https://github.com/tomaswolf/gerrit-gitblit-plugin" target="_blank">GitBlit plugin 2.13.171.1-SNAPSHOT</a>
<a href="https://github.com/tomaswolf/gerrit-gitblit-plugin" target="_blank">GitBlit plugin 2.13.171.2-SNAPSHOT</a>
</div>
<script type="text/javascript" src="version_check.js"></script>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.
<artifactId>gitblit-plugin</artifactId>
<description>GitBlit for Gerrit integrated as a plugin</description>
<name>Gerrit - GitBlit Plugin</name>
<version>2.13.171.1-SNAPSHOT</version><!-- Gerrit API version followed by collapsed GitBlit version, followed by plugin version -->
<version>2.13.171.2-SNAPSHOT</version><!-- Gerrit API version followed by collapsed GitBlit version, followed by plugin version -->
<licenses>
<license>
<name>Apache License 2.0</name>
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/com/gitblit/models/RefModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public RefModel(String displayName, Ref ref, RevObject refObject) {
this.reference = ref;
this.displayName = displayName;
this.date = internalGetDate(refObject);
this.name = (ref != null) ? ref.getName() : displayName;
this.name = ref != null ? ref.getName() : displayName;
this.type = internalGetReferencedObjectType(refObject);
this.objectId = internalGetObjectId(reference);
this.objectId = ref != null ? ref.getObjectId() : ObjectId.zeroId();
this.id = this.objectId.getName();
this.referencedObjectId = internalGetReferencedObjectId(refObject);
this.referencedId = this.referencedObjectId.getName();
Expand Down Expand Up @@ -163,10 +163,6 @@ public PersonIdent getAuthorIdent() {
return person;
}

private ObjectId internalGetObjectId(Ref reference) {
return reference.getObjectId();
}

public ObjectId getObjectId() {
if (objectId == null) {
objectId = ObjectId.fromString(id);
Expand All @@ -178,7 +174,7 @@ private boolean internalIsAnnotatedTag(Ref reference, RevObject referencedObject
if (referencedObject instanceof RevTag) {
return !getReferencedObjectId().equals(getObjectId());
}
return reference.getPeeledObjectId() != null;
return reference != null && reference.getPeeledObjectId() != null;
}

public boolean isAnnotatedTag() {
Expand Down

0 comments on commit feb51c2

Please sign in to comment.