Revision 10443
Added by Jing Tao about 7 years ago
src/edu/ucsb/nceas/metacat/restservice/v2/MNResourceHandler.java | ||
---|---|---|
1268 | 1268 |
String filename = sm.getFileName(); |
1269 | 1269 |
// then fallback to using id and extension |
1270 | 1270 |
if (filename == null) { |
1271 |
String extension = objectFormat.getExtension(); |
|
1271 |
String extension = null; |
|
1272 |
if(objectFormat != null) { |
|
1273 |
extension = objectFormat.getExtension(); |
|
1274 |
} |
|
1272 | 1275 |
if (extension == null) { |
1273 | 1276 |
extension = ObjectFormatInfo.instance().getExtension(sm.getFormatId().getValue()); |
1274 | 1277 |
} |
Also available in: Unified diff
Add the code to handle null pointer better in the get method.