Introduced use of conditional chaining operator
This commit is contained in:
1 parent
570206af77
commit
b92501ee35
14 files changed
+493
-495
No files matched your search
@@ -65,7 +65,7 @@ class DetectFileType extends Operation {
|
||||
Extension: ${type.extension}
|
||||
MIME type: ${type.mime}\n`;
|
||||
|
||||
if (type.description && type.description.length) {
|
||||
if (type?.description?.length) {
|
||||
output += `Description: ${type.description}\n`;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ class ScanForEmbeddedFiles extends Operation {
|
||||
Extension: ${type.fileDetails.extension}
|
||||
MIME type: ${type.fileDetails.mime}\n`;
|
||||
|
||||
if (type.fileDetails.description && type.fileDetails.description.length) {
|
||||
if (type?.fileDetails?.description?.length) {
|
||||
output += ` Description: ${type.fileDetails.description}\n`;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user