File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed 
aemdesign-aem-services/src/main/java/design/aem/models/v2/content Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 55import  design .aem .models .ModelProxy ;
66import  design .aem .utils .components .ComponentsUtil ;
77import  org .apache .commons .lang3 .StringUtils ;
8+ import  org .apache .sling .api .resource .Resource ;
9+ import  org .apache .sling .api .resource .ResourceResolver ;
10+ import  org .apache .sling .api .resource .ResourceUtil ;
811
912import  static  design .aem .utils .components .ComponentsUtil .*;
1013import  static  java .text .MessageFormat .format ;
@@ -38,6 +41,13 @@ protected void ready() {
3841        componentProperties .put ("wcmmode" , wcmMode );
3942
4043        String  path  = componentProperties .get ("path" ,"" );
44+ 
45+         Resource  referenceResource  = getResourceResolver ().getResource (path );
46+         if  (ResourceUtil .isNonExistingResource (referenceResource )) {
47+             LOGGER .error ("reference path does not exist {}" , path );
48+             path  = "" ;
49+         }
50+ 
4151        if  (isNotEmpty (path )) {
4252            componentProperties .put ("pathUrl" ,path .concat (".html" ));
4353        } else  {
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments