|
@@ -293,6 +293,10 @@ bool ctkDICOMDataset::CopyElement( DcmDataset* dataset, const DcmTagKey& tag, in
|
|
bool copied(true);
|
|
bool copied(true);
|
|
|
|
|
|
if (!dataset) return false;
|
|
if (!dataset) return false;
|
|
|
|
+ if (dataset == d->m_DcmDataset)
|
|
|
|
+ {
|
|
|
|
+ throw std::logic_error("Trying to copy tag to yourself. Please check application logic!");
|
|
|
|
+ }
|
|
|
|
|
|
// type 1 or 1C must exist AND have a value
|
|
// type 1 or 1C must exist AND have a value
|
|
if (!dataset->tagExistsWithValue( tag ))
|
|
if (!dataset->tagExistsWithValue( tag ))
|