Bug Summary

File:/boot/home/haiku/haiku/src/kits/locale/EditableCatalog.cpp
Location:line 144, column 3
Description:Called C++ object pointer is null

Annotated Source Code

1/*
2 * Copyright 2003-2004, Axel Dörfler, axeld@pinc-software.de
3 * Copyright 2003-2004,2012, Oliver Tappe, zooey@hirschkaefer.de
4 * Distributed under the terms of the MIT License.
5 */
6
7#include <EditableCatalog.h>
8
9#include <CatalogData.h>
10#include <MutableLocaleRoster.h>
11
12
13using BPrivate::MutableLocaleRoster;
14
15
16namespace BPrivate {
17EditableCatalog::EditableCatalog(const char* type, const char* signature,
18 const char* language)
19{
20 fCatalogData = MutableLocaleRoster::Default()->CreateCatalog(type,
21 signature, language);
22}
23
24
25EditableCatalog::~EditableCatalog()
26{
27}
28
29
30status_t
31EditableCatalog::SetString(const char* string, const char* translated,
32 const char* context, const char* comment)
33{
34 if (fCatalogData == NULL__null)
35 return B_NO_INIT((-2147483647 - 1) + 13);
36
37 return fCatalogData->SetString(string, translated, context, comment);
38}
39
40
41status_t
42EditableCatalog::SetString(int32 id, const char* translated)
43{
44 if (fCatalogData == NULL__null)
45 return B_NO_INIT((-2147483647 - 1) + 13);
46
47 return fCatalogData->SetString(id, translated);
48}
49
50
51bool
52EditableCatalog::CanWriteData() const
53{
54 if (fCatalogData == NULL__null)
55 return false;
56
57 return fCatalogData->CanWriteData();
58}
59
60
61status_t
62EditableCatalog::SetData(const char* name, BMessage* msg)
63{
64 if (fCatalogData == NULL__null)
65 return B_NO_INIT((-2147483647 - 1) + 13);
66
67 return fCatalogData->SetData(name, msg);
68}
69
70
71status_t
72EditableCatalog::SetData(uint32 id, BMessage* msg)
73{
74 if (fCatalogData == NULL__null)
75 return B_NO_INIT((-2147483647 - 1) + 13);
76
77 return fCatalogData->SetData(id, msg);
78}
79
80
81status_t
82EditableCatalog::ReadFromFile(const char* path)
83{
84 if (fCatalogData == NULL__null)
85 return B_NO_INIT((-2147483647 - 1) + 13);
86
87 return fCatalogData->ReadFromFile(path);
88}
89
90
91status_t
92EditableCatalog::ReadFromAttribute(const entry_ref& appOrAddOnRef)
93{
94 if (fCatalogData == NULL__null)
95 return B_NO_INIT((-2147483647 - 1) + 13);
96
97 return fCatalogData->ReadFromAttribute(appOrAddOnRef);
98}
99
100
101status_t
102EditableCatalog::ReadFromResource(const entry_ref& appOrAddOnRef)
103{
104 if (fCatalogData == NULL__null)
105 return B_NO_INIT((-2147483647 - 1) + 13);
106
107 return fCatalogData->ReadFromResource(appOrAddOnRef);
108}
109
110
111status_t
112EditableCatalog::WriteToFile(const char* path)
113{
114 if (fCatalogData == NULL__null)
115 return B_NO_INIT((-2147483647 - 1) + 13);
116
117 return fCatalogData->WriteToFile(path);
118}
119
120
121status_t
122EditableCatalog::WriteToAttribute(const entry_ref& appOrAddOnRef)
123{
124 if (fCatalogData == NULL__null)
125 return B_NO_INIT((-2147483647 - 1) + 13);
126
127 return fCatalogData->WriteToAttribute(appOrAddOnRef);
128}
129
130
131status_t
132EditableCatalog::WriteToResource(const entry_ref& appOrAddOnRef)
133{
134 if (fCatalogData == NULL__null)
135 return B_NO_INIT((-2147483647 - 1) + 13);
136
137 return fCatalogData->WriteToResource(appOrAddOnRef);
138}
139
140
141void EditableCatalog::MakeEmpty()
142{
143 if (fCatalogData == NULL__null)
1
Assuming pointer value is null
2
Taking true branch
144 fCatalogData->MakeEmpty();
3
Called C++ object pointer is null
145}
146
147
148BCatalogData*
149EditableCatalog::CatalogData()
150{
151 return fCatalogData;
152}
153
154
155} // namespace BPrivate