Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 45095 | Differences between
and this patch

Collapse All | Expand All

(-)src/PhotoStore.cs (-8 / +31 lines)
Lines 585-593 Link Here
585
		while (reader.Read ()) {
585
		while (reader.Read ()) {
586
			uint tag_id = Convert.ToUInt32 (reader [0]);
586
			uint tag_id = Convert.ToUInt32 (reader [0]);
587
			Tag tag = tag_store.Get (tag_id) as Tag;
587
			Tag tag = tag_store.Get (tag_id) as Tag;
588
			photo.AddTagUnsafely (tag);
588
			if(tag == null) {
589
				Console.Error.WriteLine(String.Format(
590
							"Photo {0} has invalid tag {1} in database",
591
							photo.Path, tag_id));
592
			}
593
			photo.AddTag (tag);
589
		}
594
		}
590
595
		
591
		command.Dispose ();
596
		command.Dispose ();
592
	}		
597
	}		
593
	
598
	
Lines 644-653 Link Here
644
				continue;
649
				continue;
645
			}
650
			}
646
651
647
		        if (reader [1] != null) {
652
		   	if (reader [1] != null) {
648
				uint tag_id = Convert.ToUInt32 (reader [1]);
653
				uint tag_id = Convert.ToUInt32 (reader [1]);
649
				Tag tag = tag_store.Get (tag_id) as Tag;
654
				Tag tag = tag_store.Get (tag_id) as Tag;
650
				photo.AddTagUnsafely (tag);
655
				if(tag == null) {
656
					Console.Error.WriteLine(String.Format(
657
								"Photo {0} has invalid tag {1} in database",
658
								photo.Path, tag_id));
659
					continue;
660
				}
661
				photo.AddTag (tag);
651
			}
662
			}
652
		}
663
		}
653
	}
664
	}
Lines 675-684 Link Here
675
				continue;
686
				continue;
676
			}
687
			}
677
688
678
		        if (reader [1] != null) {
689
			if (reader [1] != null) {
679
				uint tag_id = Convert.ToUInt32 (reader [1]);
690
				uint tag_id = Convert.ToUInt32 (reader [1]);
680
				Tag tag = tag_store.Get (tag_id) as Tag;
691
				Tag tag = tag_store.Get (tag_id) as Tag;
681
				photo.AddTagUnsafely (tag);
692
				if(tag == null) {
693
					Console.Error.WriteLine(String.Format(
694
								"Photo {0} has invalid tag {1} in database",
695
								photo.Path, tag_id));
696
				} else {
697
					photo.AddTag (tag);
698
				}
682
			}
699
			}
683
			if (reader [2] != null) {
700
			if (reader [2] != null) {
684
				uint version_id = Convert.ToUInt32 (reader [2]);
701
				uint version_id = Convert.ToUInt32 (reader [2]);
Lines 701-710 Link Here
701
		SqliteDataReader reader = command.ExecuteReader ();
718
		SqliteDataReader reader = command.ExecuteReader ();
702
719
703
		while (reader.Read ()) {
720
		while (reader.Read ()) {
704
		        if (reader [0] != null) {
721
			if (reader [0] != null) {
705
				uint tag_id = Convert.ToUInt32 (reader [0]);
722
				uint tag_id = Convert.ToUInt32 (reader [0]);
706
				Tag tag = tag_store.Get (tag_id) as Tag;
723
				Tag tag = tag_store.Get (tag_id) as Tag;
707
				photo.AddTagUnsafely (tag);
724
				if(tag == null) {
725
					Console.Error.WriteLine(String.Format(
726
								"Photo {0} has invalid tag {1} in database",
727
								photo.Path, tag_id));
728
				} else {
729
					photo.AddTag (tag);
730
				}
708
			}
731
			}
709
			if (reader [1] != null) {
732
			if (reader [1] != null) {
710
				uint version_id = Convert.ToUInt32 (reader [1]);
733
				uint version_id = Convert.ToUInt32 (reader [1]);

Return to bug 45095