Skip to content

Commit

Permalink
Adding a missing fix for getDefaultVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
HiranyaKavishani committed Dec 27, 2023
1 parent 130894f commit 17b8b65
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5595,7 +5595,12 @@ public int addAPI(API api, int tenantId, String organization) throws APIManageme
public String getDefaultVersion(Identifier apiId) throws APIManagementException {

try (Connection connection = APIMgtDBUtil.getConnection()) {
return getDefaultVersion(connection, (APIIdentifier) apiId);
if (apiId instanceof APIIdentifier) {
return getDefaultVersion(connection, (APIIdentifier) apiId);
} else if (apiId instanceof APIProductIdentifier) {
return getDefaultVersion(connection, (APIProductIdentifier) apiId);
}
return null;
} catch (SQLException e) {
handleException("Error while getting default version for " + apiId.getName(), e);
}
Expand Down

0 comments on commit 17b8b65

Please sign in to comment.