Revision 9819
Added by Jing Tao over 8 years ago
src/edu/ucsb/nceas/metacat/restservice/v2/MNResourceHandler.java | ||
---|---|---|
1231 | 1231 |
} |
1232 | 1232 |
// do we have mediaType/encoding in SM? |
1233 | 1233 |
MediaType mediaType = sm.getMediaType(); |
1234 |
if (mediaType == null) { |
|
1234 |
if (mediaType == null && objectFormat != null) {
|
|
1235 | 1235 |
try { |
1236 | 1236 |
mediaType = objectFormat.getMediaType(); |
1237 | 1237 |
} catch (Exception e) { |
Also available in: Unified diff
Add the check objectFormat is not null before we try to get the mediaType object from the object in the getObject method.