mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
127655: avoid nullpointer
This commit is contained in:
@@ -4,7 +4,7 @@ import { Observable, skipWhile } from 'rxjs';
|
|||||||
import { distinctUntilChanged, filter, map, mergeMap, switchMap, tap } from 'rxjs/operators';
|
import { distinctUntilChanged, filter, map, mergeMap, switchMap, tap } from 'rxjs/operators';
|
||||||
|
|
||||||
import { RequestService } from '../data/request.service';
|
import { RequestService } from '../data/request.service';
|
||||||
import { hasValue, isNotEmpty } from '../../shared/empty.util';
|
import { hasValue, hasValueOperator, isNotEmpty } from '../../shared/empty.util';
|
||||||
import {
|
import {
|
||||||
DeleteRequest,
|
DeleteRequest,
|
||||||
PostRequest,
|
PostRequest,
|
||||||
@@ -128,7 +128,8 @@ export class SubmissionRestService {
|
|||||||
this.sendGetDataRequest(endpointURL, useCachedVersionIfAvailable);
|
this.sendGetDataRequest(endpointURL, useCachedVersionIfAvailable);
|
||||||
const startTime: number = new Date().getTime();
|
const startTime: number = new Date().getTime();
|
||||||
return this.requestService.getByHref(endpointURL).pipe(
|
return this.requestService.getByHref(endpointURL).pipe(
|
||||||
map((requestEntry) => requestEntry.request.uuid),
|
map((requestEntry) => requestEntry?.request?.uuid),
|
||||||
|
hasValueOperator(),
|
||||||
distinctUntilChanged(),
|
distinctUntilChanged(),
|
||||||
switchMap((requestId) => this.rdbService.buildFromRequestUUID<SubmissionResponse>(requestId)),
|
switchMap((requestId) => this.rdbService.buildFromRequestUUID<SubmissionResponse>(requestId)),
|
||||||
// This skip ensures that if a stale object is present in the cache when you do a
|
// This skip ensures that if a stale object is present in the cache when you do a
|
||||||
|
Reference in New Issue
Block a user