Project

General

Profile

« Previous | Next » 

Revision cc4d4499

Added by Patric Plitzner over 9 years ago

fixed possible NPE and handling of null values

View differences:

7.x/modules/cdm_dataportal/includes/pages.inc
138 138
                    $protologue = $derivateHierarchy->protologue;
139 139
                    $citation = $derivateHierarchy->citation;
140 140
                    $types = "";
141
                    foreach($derivateHierarchy->types as $typeStatus => $accessionList){
142
                        $types .= $typeStatus;
143
                        foreach($accessionList as $accessionNumber){
144
                            $types .= " (" . $accessionNumber . ") ";
145
                        }
141
                    if(isset($derivateHierarchy->types)){
142
                    	foreach($derivateHierarchy->types as $typeStatus => $accessionList){
143
                        	$types .= $typeStatus;
144
                        	foreach($accessionList as $accessionNumber){
145
                            	$types .= " (" . $accessionNumber . ") ";
146
                        	}
147
                    	}
146 148
                    }
147 149
                    $specimenScans = createLinks($derivateHierarchy->specimenScans);
148 150
                    $molecularData = createLinks($derivateHierarchy->molecularData);
......
320 322
    $html = "";
321 323
    if ($linkTextPairList) {
322 324
        foreach ($linkTextPairList as $linkTextPair) {
325
            if($linkTextPair->first!=""){
323 326
            $html .= '<a href="' . $linkTextPair->first . '">' . $linkTextPair->second . "</a>";
327
        	}
328
            else{
329
                $html .= $linkTextPair->second;
330
            }
324 331
        }
325 332
    }
326 333
    return $html;

Also available in: Unified diff